# HG changeset patch # User Miles Bader # Date 836704791 0 # Node ID 5da6a61ce8273722d93d74e2ca0d94058061823e # Parent 69c516d109e743861fe981b9d0727f0abed01659 (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. diff -r 69c516d109e7 -r 5da6a61ce827 src/msdos.c --- a/src/msdos.c Sun Jul 07 01:59:35 1996 +0000 +++ b/src/msdos.c Sun Jul 07 01:59:51 1996 +0000 @@ -2130,12 +2130,16 @@ /* ----------------------- DOS / UNIX conversion --------------------- */ +void msdos_downcase_filename (unsigned char *); + /* Destructively turn backslashes into slashes. */ void dostounix_filename (p) register char *p; { + msdos_downcase_filename (p); + while (*p) { if (*p == '\\') @@ -2150,6 +2154,12 @@ unixtodos_filename (p) register char *p; { + if (p[1] == ':' && *p >= 'A' && *p <= 'Z') + { + *p += 'a' - 'A'; + p += 2; + } + while (*p) { if (*p == '/') @@ -2159,7 +2169,6 @@ } /* Get the default directory for a given drive. 0=def, 1=A, 2=B, ... */ -void msdos_downcase_filename (unsigned char *); int getdefdir (drive, dst) @@ -2376,7 +2385,7 @@ "c:/emacs/bin/emacs.exe" our root will be "c:/emacs". */ root = alloca (MAXPATHLEN + 20); _fixpath (argv[0], root); - strlwr (root); + msdos_downcase_filename (root); len = strlen (root); while (len > 0 && root[len] != '/' && root[len] != ':') len--; @@ -2410,7 +2419,6 @@ if (!s) s = "c:/command.com"; t = alloca (strlen (s) + 1); strcpy (t, s); - strlwr (t); dostounix_filename (t); setenv ("SHELL", t, 0); @@ -2421,7 +2429,6 @@ /* Current directory is always considered part of MsDos's path but it is not normally mentioned. Now it is. */ strcat (strcpy (t, ".;"), s); - strlwr (t); dostounix_filename (t); /* Not a single file name, but this should work. */ setenv ("PATH", t, 1);