summarylogtreecommitdiffstats
path: root/10-gcc-4.1.2-c-incpath.patch
diff options
context:
space:
mode:
authorABDULLATIF Mouhamadi2017-05-24 01:24:14 +0200
committerABDULLATIF Mouhamadi2017-05-24 01:24:14 +0200
commitc7319c9a7fbc00c70bb104ab852eb4182ba6e36e (patch)
tree05f2d0142cd2c4b43754b6e026f706a50d28aab4 /10-gcc-4.1.2-c-incpath.patch
downloadaur-gcc-avr-tinyos.tar.gz
first commit
Diffstat (limited to '10-gcc-4.1.2-c-incpath.patch')
-rw-r--r--10-gcc-4.1.2-c-incpath.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/10-gcc-4.1.2-c-incpath.patch b/10-gcc-4.1.2-c-incpath.patch
new file mode 100644
index 000000000000..2f628ceed4c1
--- /dev/null
+++ b/10-gcc-4.1.2-c-incpath.patch
@@ -0,0 +1,28 @@
+--- gcc/c-incpath.c.orig 2005-11-30 14:27:58.607093300 -0700
++++ gcc/c-incpath.c 2005-11-30 14:28:20.450983100 -0700
+@@ -331,13 +331,18 @@
+ cpp_dir *p;
+
+ #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+- /* Convert all backslashes to slashes. The native CRT stat()
+- function does not recognize a directory that ends in a backslash
+- (unless it is a drive root dir, such "c:\"). Forward slashes,
+- trailing or otherwise, cause no problems for stat(). */
+- char* c;
+- for (c = path; *c; c++)
+- if (*c == '\\') *c = '/';
++ /* Remove unnecessary trailing slashes. On some versions of MS
++ Windows, trailing _forward_ slashes cause no problems for stat().
++ On newer versions, stat() does not recognise a directory that ends
++ in a '\\' or '/', unless it is a drive root dir, such as "c:/",
++ where it is obligatory. */
++ int pathlen = strlen (path);
++ char* end = path + pathlen - 1;
++ /* Preserve the lead '/' or lead "c:/". */
++ char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1);
++
++ for (; end > start && IS_DIR_SEPARATOR (*end); end--)
++ *end = 0;
+ #endif
+
+ p = xmalloc (sizeof (cpp_dir));