Mail Archives: djgpp-workers/2005/04/18/11:53:49
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 -