diff options
| author | Miles Bader | 1996-07-07 01:59:51 +0000 |
|---|---|---|
| committer | Miles Bader | 1996-07-07 01:59:51 +0000 |
| commit | e2643e3e87932c531010bbdc2385b8e476ee6fbb (patch) | |
| tree | 67eae42e6b28555de68feb0b3d9285bc3bb0882d /src | |
| parent | f54b565c8756f85e2ac46d47be8c4c55a7cff3ba (diff) | |
| download | emacs-e2643e3e87932c531010bbdc2385b8e476ee6fbb.tar.gz emacs-e2643e3e87932c531010bbdc2385b8e476ee6fbb.zip | |
(dostounix_filename): On caseless filesystems, downcase the filename.
(unixtodos_filename): Downcase the drive letter.
(init_environment): Downcase the pathnames in the environment only when
running on caseless filesystems.
Diffstat (limited to 'src')
| -rw-r--r-- | src/msdos.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/msdos.c b/src/msdos.c index 9577e04f569..99cb08e71ef 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -2130,12 +2130,16 @@ x_pixel_height (struct frame *f) | |||
| 2130 | 2130 | ||
| 2131 | /* ----------------------- DOS / UNIX conversion --------------------- */ | 2131 | /* ----------------------- DOS / UNIX conversion --------------------- */ |
| 2132 | 2132 | ||
| 2133 | void msdos_downcase_filename (unsigned char *); | ||
| 2134 | |||
| 2133 | /* Destructively turn backslashes into slashes. */ | 2135 | /* Destructively turn backslashes into slashes. */ |
| 2134 | 2136 | ||
| 2135 | void | 2137 | void |
| 2136 | dostounix_filename (p) | 2138 | dostounix_filename (p) |
| 2137 | register char *p; | 2139 | register char *p; |
| 2138 | { | 2140 | { |
| 2141 | msdos_downcase_filename (p); | ||
| 2142 | |||
| 2139 | while (*p) | 2143 | while (*p) |
| 2140 | { | 2144 | { |
| 2141 | if (*p == '\\') | 2145 | if (*p == '\\') |
| @@ -2150,6 +2154,12 @@ void | |||
| 2150 | unixtodos_filename (p) | 2154 | unixtodos_filename (p) |
| 2151 | register char *p; | 2155 | register char *p; |
| 2152 | { | 2156 | { |
| 2157 | if (p[1] == ':' && *p >= 'A' && *p <= 'Z') | ||
| 2158 | { | ||
| 2159 | *p += 'a' - 'A'; | ||
| 2160 | p += 2; | ||
| 2161 | } | ||
| 2162 | |||
| 2153 | while (*p) | 2163 | while (*p) |
| 2154 | { | 2164 | { |
| 2155 | if (*p == '/') | 2165 | if (*p == '/') |
| @@ -2159,7 +2169,6 @@ unixtodos_filename (p) | |||
| 2159 | } | 2169 | } |
| 2160 | 2170 | ||
| 2161 | /* Get the default directory for a given drive. 0=def, 1=A, 2=B, ... */ | 2171 | /* Get the default directory for a given drive. 0=def, 1=A, 2=B, ... */ |
| 2162 | void msdos_downcase_filename (unsigned char *); | ||
| 2163 | 2172 | ||
| 2164 | int | 2173 | int |
| 2165 | getdefdir (drive, dst) | 2174 | getdefdir (drive, dst) |
| @@ -2376,7 +2385,7 @@ init_environment (argc, argv, skip_args) | |||
| 2376 | "c:/emacs/bin/emacs.exe" our root will be "c:/emacs". */ | 2385 | "c:/emacs/bin/emacs.exe" our root will be "c:/emacs". */ |
| 2377 | root = alloca (MAXPATHLEN + 20); | 2386 | root = alloca (MAXPATHLEN + 20); |
| 2378 | _fixpath (argv[0], root); | 2387 | _fixpath (argv[0], root); |
| 2379 | strlwr (root); | 2388 | msdos_downcase_filename (root); |
| 2380 | len = strlen (root); | 2389 | len = strlen (root); |
| 2381 | while (len > 0 && root[len] != '/' && root[len] != ':') | 2390 | while (len > 0 && root[len] != '/' && root[len] != ':') |
| 2382 | len--; | 2391 | len--; |
| @@ -2410,7 +2419,6 @@ init_environment (argc, argv, skip_args) | |||
| 2410 | if (!s) s = "c:/command.com"; | 2419 | if (!s) s = "c:/command.com"; |
| 2411 | t = alloca (strlen (s) + 1); | 2420 | t = alloca (strlen (s) + 1); |
| 2412 | strcpy (t, s); | 2421 | strcpy (t, s); |
| 2413 | strlwr (t); | ||
| 2414 | dostounix_filename (t); | 2422 | dostounix_filename (t); |
| 2415 | setenv ("SHELL", t, 0); | 2423 | setenv ("SHELL", t, 0); |
| 2416 | 2424 | ||
| @@ -2421,7 +2429,6 @@ init_environment (argc, argv, skip_args) | |||
| 2421 | /* Current directory is always considered part of MsDos's path but it is | 2429 | /* Current directory is always considered part of MsDos's path but it is |
| 2422 | not normally mentioned. Now it is. */ | 2430 | not normally mentioned. Now it is. */ |
| 2423 | strcat (strcpy (t, ".;"), s); | 2431 | strcat (strcpy (t, ".;"), s); |
| 2424 | strlwr (t); | ||
| 2425 | dostounix_filename (t); /* Not a single file name, but this should work. */ | 2432 | dostounix_filename (t); /* Not a single file name, but this should work. */ |
| 2426 | setenv ("PATH", t, 1); | 2433 | setenv ("PATH", t, 1); |
| 2427 | 2434 | ||