Date: Thu, 3 Oct 1996 10:19:32 +0200 (IST) From: Eli Zaretskii To: djgpp-workers AT delorie DOT com Subject: `fixpath' drive letter case Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII `_fixpath' was inconsistent about the letter-case of the drive letter. These patches make it always return the drive letter in lower case (unless it is one of those 6 Novell drive letters between `Z' and `a'). Programs which compare pathnames with `strcmp' might break if the case is not consistent (one of them is `su' from GNU Sh-utils). *** src/libc/posix/sys/stat/fixpath.c~1 Fri Aug 16 13:35:10 1996 --- src/libc/posix/sys/stat/fixpath.c Wed Oct 2 13:50:08 1996 *************** *** 90,99 **** && (*(ip + 1) == ':')) { if (*ip >= 'a' && *ip <= 'z') drive_number = *ip - 'a'; else drive_number = *ip - 'A'; ! *op++ = *ip++; *op++ = *ip++; } else --- 90,108 ---- && (*(ip + 1) == ':')) { if (*ip >= 'a' && *ip <= 'z') + { drive_number = *ip - 'a'; + *op++ = *ip++; + } else + { drive_number = *ip - 'A'; ! if (*ip <= 'Z') ! *op++ = drive_number + 'a'; ! else ! *op++ = *ip; ! ++ip; ! } *op++ = *ip++; } else