changeset 15588:e49a2eb71713

(msdos_downcase_filename): Always lower-case drive letters, even on systems that preserve case in filenames.
author Miles Bader <miles@gnu.org>
date Tue, 02 Jul 1996 16:27:07 +0000
parents 515819688789
children 15f033c2250f
files src/msdos.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/msdos.c	Tue Jul 02 16:25:58 1996 +0000
+++ b/src/msdos.c	Tue Jul 02 16:27:07 1996 +0000
@@ -2305,6 +2305,17 @@
 msdos_downcase_filename (p)
      register unsigned char *p;
 {
+  /* Always lower-case drive letters a-z, even if the filesystem
+     preserves case in filenames.
+     This is so MSDOS filenames could be compared by string comparison
+     functions that are case-sensitive.  Even case-preserving filesystems
+     do not distinguish case in drive letters.  */
+  if (p[1] == ':' && *p >= 'A' && *p <= 'Z')
+    {
+      *p += 'a' - 'A';
+      p += 2;
+    }
+
   /* Under LFN we expect to get pathnames in their true case.  */
   if (NILP (Fmsdos_long_file_names ()))
     for ( ; *p; p++)