delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/10/03/04:23:05

Date: Thu, 3 Oct 1996 10:19:32 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp-workers AT delorie DOT com
Subject: `fixpath' drive letter case
Message-Id: <Pine.SUN.3.91.961003101526.27330J-100000@is>
Mime-Version: 1.0

`_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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019