diff options
| author | Eli Zaretskii | 2001-12-19 19:00:44 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2001-12-19 19:00:44 +0000 |
| commit | bf7943066e1b52284bafe142626ff8c87609a0da (patch) | |
| tree | d39b23f4cf3411565c611917e0998e7b0e0bed92 /src | |
| parent | dd693537fd33a3771cb4001373038c50529a3d85 (diff) | |
| download | emacs-bf7943066e1b52284bafe142626ff8c87609a0da.tar.gz emacs-bf7943066e1b52284bafe142626ff8c87609a0da.zip | |
(emacs_root_dir): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/msdos.c | 11 | ||||
| -rw-r--r-- | src/w32.c | 15 |
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 @@ | |||
| 1 | 2001-12-19 Eli Zaretskii <eliz@is.elta.co.il> | 1 | 2001-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 | ||
| 4122 | char * | ||
| 4123 | emacs_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 | ||
| 4123 | int | 4134 | int |
| @@ -875,6 +875,21 @@ init_environment (char ** argv) | |||
| 875 | init_user_info (); | 875 | init_user_info (); |
| 876 | } | 876 | } |
| 877 | 877 | ||
| 878 | char * | ||
| 879 | emacs_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 |