aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2001-12-19 19:00:44 +0000
committerEli Zaretskii2001-12-19 19:00:44 +0000
commitbf7943066e1b52284bafe142626ff8c87609a0da (patch)
treed39b23f4cf3411565c611917e0998e7b0e0bed92 /src
parentdd693537fd33a3771cb4001373038c50529a3d85 (diff)
downloademacs-bf7943066e1b52284bafe142626ff8c87609a0da.tar.gz
emacs-bf7943066e1b52284bafe142626ff8c87609a0da.zip
(emacs_root_dir): New function.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/msdos.c11
-rw-r--r--src/w32.c15
3 files changed, 33 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 019ec65ffd1..0acab8715f6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
12001-12-19 Eli Zaretskii <eliz@is.elta.co.il> 12001-12-19 Eli Zaretskii <eliz@is.elta.co.il>
2 2
3 * w32.c (emacs_root_dir): New function.
4
5 * msdos.c (emacs_root_dir): New function.
6
7 * fileio.c (Fexpand_file_name) [DOS_NT]: Use the root directory
8 of the current drive as the fallback for default_directory.
9
3 * dired.c (file_name_completion): Run the elements of 10 * dired.c (file_name_completion): Run the elements of
4 completion-ignored-extensions through ENCODE_FILE. 11 completion-ignored-extensions through ENCODE_FILE.
5 12
diff --git a/src/msdos.c b/src/msdos.c
index da39c9a99fa..168d3dfc88a 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -38,6 +38,7 @@ Boston, MA 02111-1307, USA. */
38#include <string.h> /* for bzero and string functions */ 38#include <string.h> /* for bzero and string functions */
39#include <sys/stat.h> /* for _fixpath */ 39#include <sys/stat.h> /* for _fixpath */
40#include <unistd.h> /* for chdir, dup, dup2, etc. */ 40#include <unistd.h> /* for chdir, dup, dup2, etc. */
41#include <dir.h> /* for getdisk */
41#if __DJGPP__ >= 2 42#if __DJGPP__ >= 2
42#include <fcntl.h> 43#include <fcntl.h>
43#include <io.h> /* for setmode */ 44#include <io.h> /* for setmode */
@@ -4118,6 +4119,16 @@ getdefdir (drive, dst)
4118 return 1; 4119 return 1;
4119} 4120}
4120 4121
4122char *
4123emacs_root_dir (void)
4124{
4125 static char root_dir[4];
4126
4127 sprintf (root_dir, "%c:/", 'A' + getdisk ());
4128 root_dir[0] = tolower (root_dir[0]);
4129 return root_dir;
4130}
4131
4121/* Remove all CR's that are followed by a LF. */ 4132/* Remove all CR's that are followed by a LF. */
4122 4133
4123int 4134int
diff --git a/src/w32.c b/src/w32.c
index dbdd13d4d33..a8e4a5f37da 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -875,6 +875,21 @@ init_environment (char ** argv)
875 init_user_info (); 875 init_user_info ();
876} 876}
877 877
878char *
879emacs_root_dir (void)
880{
881 static char root_dir[FILENAME_MAX];
882 const char *p;
883
884 p = getenv ("emacs_dir");
885 if (p == NULL)
886 abort ();
887 strcpy (root_dir, p);
888 root_dir[parse_root (root_dir, NULL)] = '\0';
889 dostounix_filename (root_dir);
890 return root_dir;
891}
892
878/* We don't have scripts to automatically determine the system configuration 893/* We don't have scripts to automatically determine the system configuration
879 for Emacs before it's compiled, and we don't want to have to make the 894 for Emacs before it's compiled, and we don't want to have to make the
880 user enter it, so we define EMACS_CONFIGURATION to invoke this runtime 895 user enter it, so we define EMACS_CONFIGURATION to invoke this runtime