delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2005/04/18/11:53:49

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
From: Andris Pavenis <pavenis AT latnet DOT lv>
To: gcc-patches AT gcc DOT gnu DOT org, djgpp-workers AT delorie DOT com
Subject: [libiberty] [PATCH] Use case insensitive comparisson in make_relative_prefix for DOS based filesystem
Date: Mon, 18 Apr 2005 18:53:31 +0300
User-Agent: KMail/1.8
MIME-Version: 1.0
Message-Id: <200504181853.31597.pavenis@latnet.lv>
X-Virus-Scanned: amavisd-new at fgi.fi
Reply-To: djgpp-workers AT delorie DOT com

This patch for HEAD branch modifies make-relative-prefix.c to use symbol case 
insensitive for filenames in make_relativce_prefix() in case when file system is case
insensitive (for example for DJGPP)

Andris


2005-04-18  Andris Pavenis  <pavenis AT latnet DOT lv>

 * make-relative-prefix: New macro FILENAME_COMPARE.


Index: gcc/libiberty/make-relative-prefix.c
===================================================================
RCS file: /cvs/gcc/gcc/libiberty/make-relative-prefix.c,v
retrieving revision 1.5
diff -u -p -3 -r1.5 make-relative-prefix.c
--- gcc/libiberty/make-relative-prefix.c 27 Mar 2005 15:31:13 -0000 1.5
+++ gcc/libiberty/make-relative-prefix.c 18 Apr 2005 15:26:43 -0000
@@ -78,6 +78,7 @@ relative prefix can be found, return @co
 #  define HAVE_DOS_BASED_FILE_SYSTEM
 #  define HAVE_HOST_EXECUTABLE_SUFFIX
 #  define HOST_EXECUTABLE_SUFFIX ".exe"
+#  define FILENAME_COMPARE strcasecmp
 #  ifndef DIR_SEPARATOR_2 
 #    define DIR_SEPARATOR_2 '\\'
 #  endif
@@ -93,6 +94,10 @@ relative prefix can be found, return @co
  (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
 #endif
 
+#ifndef FILENAME_COMPARE
+#  define FILENAME_COMPARE strcmp
+#endif
+
 #define DIR_UP ".."
 
 static char *save_string (const char *, int);
@@ -310,7 +315,7 @@ make_relative_prefix (const char *progna
     {
       for (i = 0; i < bin_num; i++)
  {
-   if (strcmp (prog_dirs[i], bin_dirs[i]) != 0)
+   if (FILENAME_COMPARE (prog_dirs[i], bin_dirs[i]) != 0)
      break;
  }
 
@@ -335,7 +340,7 @@ make_relative_prefix (const char *progna
   n = (prefix_num < bin_num) ? prefix_num : bin_num;
   for (common = 0; common < n; common++)
     {
-      if (strcmp (bin_dirs[common], prefix_dirs[common]) != 0)
+      if (FILENAME_COMPARE (bin_dirs[common], prefix_dirs[common]) != 0)
  break;
     }
 

- Raw text -


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