aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1996-06-03 21:16:17 +0000
committerRichard M. Stallman1996-06-03 21:16:17 +0000
commitf94988a7337042820e301494dbb3db8ec6995305 (patch)
tree81c2ebd7dd3749f6b691bb9e43c05342b56173bd /src
parent7d2cdc3cc750ec6d09d9953e34acedb31569d82e (diff)
downloademacs-f94988a7337042820e301494dbb3db8ec6995305.tar.gz
emacs-f94988a7337042820e301494dbb3db8ec6995305.zip
(DRIVE_LETTER): [DOS_NT] New macro.
(expand_file_name): Apply DRIVE_LETTER macro to drive names.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 062f75ede81..30ff2c4570b 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -102,9 +102,12 @@ extern char *strerror ();
102 redirector allows the six letters between 'Z' and 'a' as well. */ 102 redirector allows the six letters between 'Z' and 'a' as well. */
103#ifdef MSDOS 103#ifdef MSDOS
104#define IS_DRIVE(x) ((x) >= 'A' && (x) <= 'z') 104#define IS_DRIVE(x) ((x) >= 'A' && (x) <= 'z')
105#define DRIVE_LETTER(x) (x)
105#endif 106#endif
106#ifdef WINDOWSNT 107#ifdef WINDOWSNT
107#define IS_DRIVE(x) isalpha (x) 108#define IS_DRIVE(x) isalpha (x)
109extern Lisp_Object Vwin32_downcase_file_names;
110#define DRIVE_LETTER(x) (NILP (Vwin32_downcase_file_names) ? (x) : tolower (x))
108#endif 111#endif
109#endif 112#endif
110 113
@@ -1065,7 +1068,7 @@ See also the function `substitute-in-file-name'.")
1065 if (strcmp (nm - 2, XSTRING (name)->data) != 0) 1068 if (strcmp (nm - 2, XSTRING (name)->data) != 0)
1066 { 1069 {
1067 name = make_string (nm - 2, p - nm + 2); 1070 name = make_string (nm - 2, p - nm + 2);
1068 XSTRING (name)->data[0] = drive; 1071 XSTRING (name)->data[0] = DRIVE_LETTER (drive);
1069 XSTRING (name)->data[1] = ':'; 1072 XSTRING (name)->data[1] = ':';
1070 } 1073 }
1071 return name; 1074 return name;
@@ -1159,7 +1162,7 @@ See also the function `substitute-in-file-name'.")
1159 { 1162 {
1160 /* Either nm starts with /, or drive isn't mounted. */ 1163 /* Either nm starts with /, or drive isn't mounted. */
1161 newdir = alloca (4); 1164 newdir = alloca (4);
1162 newdir[0] = drive; 1165 newdir[0] = DRIVE_LETTER (drive);
1163 newdir[1] = ':'; 1166 newdir[1] = ':';
1164 newdir[2] = '/'; 1167 newdir[2] = '/';
1165 newdir[3] = 0; 1168 newdir[3] = 0;
@@ -1407,7 +1410,7 @@ See also the function `substitute-in-file-name'.")
1407 { 1410 {
1408 if (!drive) abort (); 1411 if (!drive) abort ();
1409 target -= 2; 1412 target -= 2;
1410 target[0] = drive; 1413 target[0] = DRIVE_LETTER (drive);
1411 target[1] = ':'; 1414 target[1] = ':';
1412 } 1415 }
1413 CORRECT_DIR_SEPS (target); 1416 CORRECT_DIR_SEPS (target);