diff options
| author | Karl Heuer | 1995-04-13 17:45:06 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-04-13 17:45:06 +0000 |
| commit | c0fa5a0bf35a5b9b051e1ce12188f74a21621483 (patch) | |
| tree | 8709a1b10b304030d1c31a3399e74cb1d8b0e4b7 /src | |
| parent | 231c740a450fc16fce7b69193e7beb10d0d4cfac (diff) | |
| download | emacs-c0fa5a0bf35a5b9b051e1ce12188f74a21621483.tar.gz emacs-c0fa5a0bf35a5b9b051e1ce12188f74a21621483.zip | |
(Fexpand_file_name): Use IS_DIRECTORY_SEP instead of
special code for WINDOWSNT.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 47 |
1 files changed, 13 insertions, 34 deletions
diff --git a/src/fileio.c b/src/fileio.c index 28da19785ac..b81edaee57e 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -850,14 +850,11 @@ See also the function `substitute-in-file-name'.") | |||
| 850 | /* "//" anywhere isn't necessarily hairy; we just start afresh | 850 | /* "//" anywhere isn't necessarily hairy; we just start afresh |
| 851 | with the second slash. */ | 851 | with the second slash. */ |
| 852 | if (IS_DIRECTORY_SEP (p[0]) && IS_DIRECTORY_SEP (p[1]) | 852 | if (IS_DIRECTORY_SEP (p[0]) && IS_DIRECTORY_SEP (p[1]) |
| 853 | #ifdef APOLLO | 853 | #if defined (APOLLO) || defined (WINDOWSNT) |
| 854 | /* // at start of filename is meaningful on Apollo system */ | 854 | /* // at start of filename is meaningful on Apollo |
| 855 | && nm != p | 855 | and WindowsNT systems */ |
| 856 | #endif /* APOLLO */ | ||
| 857 | #ifdef WINDOWSNT | ||
| 858 | /* \\ or // at the start of a pathname is meaningful on NT. */ | ||
| 859 | && nm != p | 856 | && nm != p |
| 860 | #endif /* WINDOWSNT */ | 857 | #endif /* APOLLO || WINDOWSNT */ |
| 861 | ) | 858 | ) |
| 862 | nm = p + 1; | 859 | nm = p + 1; |
| 863 | 860 | ||
| @@ -1139,20 +1136,12 @@ See also the function `substitute-in-file-name'.") | |||
| 1139 | { | 1136 | { |
| 1140 | *o++ = *p++; | 1137 | *o++ = *p++; |
| 1141 | } | 1138 | } |
| 1142 | else if ( | 1139 | else if (IS_DIRECTORY_SEP (p[0]) && IS_DIRECTORY_SEP (p[1]) |
| 1143 | #ifdef WINDOWSNT | 1140 | #if defined (APOLLO) || defined (WINDOWSNT) |
| 1144 | (!strncmp (p, "\\\\", 2) || !strncmp (p, "//", 2)) | 1141 | /* // at start of filename is meaningful in Apollo |
| 1145 | #else /* not WINDOWSNT */ | 1142 | and WindowsNT systems */ |
| 1146 | !strncmp (p, "//", 2) | ||
| 1147 | #endif /* not WINDOWSNT */ | ||
| 1148 | #ifdef APOLLO | ||
| 1149 | /* // at start of filename is meaningful in Apollo system */ | ||
| 1150 | && o != target | 1143 | && o != target |
| 1151 | #endif /* APOLLO */ | 1144 | #endif /* APOLLO */ |
| 1152 | #ifdef WINDOWSNT | ||
| 1153 | /* \\ at start of filename is meaningful in Windows-NT */ | ||
| 1154 | && o != target | ||
| 1155 | #endif /* WINDOWSNT */ | ||
| 1156 | ) | 1145 | ) |
| 1157 | { | 1146 | { |
| 1158 | o = target; | 1147 | o = target; |
| @@ -1169,29 +1158,19 @@ See also the function `substitute-in-file-name'.") | |||
| 1169 | *o++ = *p; | 1158 | *o++ = *p; |
| 1170 | p += 2; | 1159 | p += 2; |
| 1171 | } | 1160 | } |
| 1172 | else if ( | 1161 | else if (IS_DIRECTORY_SEP (p[0]) && p[1] == '.' && p[2] == '.' |
| 1173 | #ifdef WINDOWSNT | ||
| 1174 | (!strncmp (p, "\\..", 3) || !strncmp (p, "/..", 3)) | ||
| 1175 | #else /* not WINDOWSNT */ | ||
| 1176 | !strncmp (p, "/..", 3) | ||
| 1177 | #endif /* not WINDOWSNT */ | ||
| 1178 | /* `/../' is the "superroot" on certain file systems. */ | 1162 | /* `/../' is the "superroot" on certain file systems. */ |
| 1179 | && o != target | 1163 | && o != target |
| 1180 | && (IS_DIRECTORY_SEP (p[3]) || p[3] == 0)) | 1164 | && (IS_DIRECTORY_SEP (p[3]) || p[3] == 0)) |
| 1181 | { | 1165 | { |
| 1182 | while (o != target && (--o) && !IS_DIRECTORY_SEP (*o)) | 1166 | while (o != target && (--o) && !IS_DIRECTORY_SEP (*o)) |
| 1183 | ; | 1167 | ; |
| 1184 | #ifdef APOLLO | 1168 | #if defined (APOLLO) || defined (WINDOWSNT) |
| 1185 | if (o == target + 1 && o[-1] == '/' && o[0] == '/') | 1169 | if (o == target + 1 |
| 1186 | ++o; | 1170 | && IS_DIRECTORY_SEP (o[-1]) && IS_DIRECTORY_SEP (o[0])) |
| 1187 | else | ||
| 1188 | #endif /* APOLLO */ | ||
| 1189 | #ifdef WINDOWSNT | ||
| 1190 | if (o == target + 1 && (o[-1] == '/' && o[0] == '/') | ||
| 1191 | || (o[-1] == '\\' && o[0] == '\\')) | ||
| 1192 | ++o; | 1171 | ++o; |
| 1193 | else | 1172 | else |
| 1194 | #endif /* WINDOWSNT */ | 1173 | #endif /* APOLLO || WINDOWSNT */ |
| 1195 | if (o == target && IS_ANY_SEP (*o)) | 1174 | if (o == target && IS_ANY_SEP (*o)) |
| 1196 | ++o; | 1175 | ++o; |
| 1197 | p += 3; | 1176 | p += 3; |