diff mbox

[preprocessor] Fix 56896

Message ID 52A761C8.5060507@qnx.com
State New
Headers show

Commit Message

Ryan Mansfield Dec. 10, 2013, 6:47 p.m. UTC
Fixes missing DIR_SEPARATOR if --with-gxx-include-dir configured as 
subdir of sysroot.

2013-12-10  Ryan Mansfield  <rmansfield@qnx.com>

         PR preprocessor/56896
         * incpath.c (add_standard_paths): Strip trailing sysroot 
DIR_SEPARATOR
         only if appended path begins with DIR_SEPARATOR.

Regards,

Ryan Mansfield

Comments

Ryan Mansfield Jan. 7, 2014, 6:05 p.m. UTC | #1
On 13-12-10 01:47 PM, Ryan Mansfield wrote:
> Fixes missing DIR_SEPARATOR if --with-gxx-include-dir configured as
> subdir of sysroot.
>
> 2013-12-10  Ryan Mansfield  <rmansfield@qnx.com>
>
>          PR preprocessor/56896
>          * incpath.c (add_standard_paths): Strip trailing sysroot
> DIR_SEPARATOR
>          only if appended path begins with DIR_SEPARATOR.

Ping?

Regards,

Ryan Mansfield
diff mbox

Patch

Index: incpath.c
===================================================================
--- incpath.c	(revision 205857)
+++ incpath.c	(working copy)
@@ -179,7 +179,8 @@ 
 	      char *sysroot_no_trailing_dir_separator = xstrdup (sysroot);
 	      size_t sysroot_len = strlen (sysroot);
 
-	      if (sysroot_len > 0 && sysroot[sysroot_len - 1] == DIR_SEPARATOR)
+	      if (sysroot_len > 0 && sysroot[sysroot_len - 1] == DIR_SEPARATOR
+		  && p->fname[0] == DIR_SEPARATOR)
 		sysroot_no_trailing_dir_separator[sysroot_len - 1] = '\0';
 	      str = concat (sysroot_no_trailing_dir_separator, p->fname, NULL);
 	      free (sysroot_no_trailing_dir_separator);