bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Win32 File Name Compares and Normalization


From: Matthew Von-Maszewski
Subject: Win32 File Name Compares and Normalization
Date: Mon, 10 Sep 2001 12:04:46 -0400

Greetings,

I have been doing extensive work with GNU make and Microsoft's compiler.
This includes creating a dependency generator similar the gcc's .d files.
It has become obvious that a couple of the make's functions need to become
case insensitive when on a Win 32 platform.  Microsoft's file names are
internally considered to be case insensitive for its file operations and
matching.

I have listed the changes below that I found sufficient to create normalized
filenames (all lowercase) and to remove case sensitive compares (this needs
a cleaner implementation).

[My dependency generator depends upon a preprocessor dump from Microsoft's
compiler.  Depending upon the command line options, sometimes the
preprocessor normalizes all file names to lower case (e.g. /ZI option).
Other times case is left as found in the file system.  Lovely.]

All changes are against the version 3.79.1 download.

Would you please consider this change request?

Thank you,
Matthew

Index: glob/fnmatch.c
===================================================================
RCS file: /home/cvsroot/gnumake/glob/fnmatch.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** glob/fnmatch.c      2001/09/10 15:33:48     1.1.1.1
--- glob/fnmatch.c      2001/09/10 15:37:35     1.2
***************
*** 168,174 ****
  # ifdef _LIBC
  #  define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
  # else
! #  define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) :
(c))
  # endif

    while ((c = *p++) != '\0')
--- 168,176 ----
  # ifdef _LIBC
  #  define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
  # else
! /*#  define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) :
(c)
)*/
! /* mev */
! #  define FOLD(c) ( ISUPPER (c) ? tolower (c) : (c))
  # endif


Index: w32/pathstuff.c
===================================================================
RCS file: /home/cvsroot/gnumake/w32/pathstuff.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** w32/pathstuff.c     2001/09/10 15:33:48     1.1.1.1
--- w32/pathstuff.c     2001/09/10 15:37:36     1.2
***************
*** 80,85 ****
--- 80,87 ----
          if (*p == '\\')
              *p = '/';

+ /* mev */
+     strlwr(w32_path);
      return w32_path;
  }

cvs server: Diffing w32/compat
Index: w32/compat/dirent.c
===================================================================
RCS file: /home/cvsroot/gnumake/w32/compat/dirent.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** w32/compat/dirent.c 2001/09/10 15:33:48     1.1.1.1
--- w32/compat/dirent.c 2001/09/10 15:37:36     1.2
***************
*** 116,122 ****
        /* fill in struct dirent values */
        pDir->dir_sdReturn.d_ino = -1;
        strcpy(pDir->dir_sdReturn.d_name, wfdFindData.cFileName);
!
        return &pDir->dir_sdReturn;
  }

--- 116,123 ----
        /* fill in struct dirent values */
        pDir->dir_sdReturn.d_ino = -1;
        strcpy(pDir->dir_sdReturn.d_name, wfdFindData.cFileName);
! /* mev */
!         strlwr(pDir->dir_sdReturn.d_name);
        return &pDir->dir_sdReturn;
  }



======================
Matthew Von-Maszewski
 address@hidden
 508-870-0118





reply via email to

[Prev in Thread] Current Thread [Next in Thread]