diff options
author | Matthias Klose <doko@ubuntu.com> | 2012-01-26 23:34:58 +0000 |
---|---|---|
committer | Matthias Klose <doko@gcc.gnu.org> | 2012-01-26 23:34:58 +0000 |
commit | 2fda54bd153102ac40092ac4f38a7d885257de37 (patch) | |
tree | 2fc10497db064ce149773544b78b0900ecfbf688 /gcc/gcc.c | |
parent | 3beac6b971c4c63da1a1f23b46f296d6156d7d3f (diff) | |
download | gcc-2fda54bd153102ac40092ac4f38a7d885257de37.zip gcc-2fda54bd153102ac40092ac4f38a7d885257de37.tar.gz gcc-2fda54bd153102ac40092ac4f38a7d885257de37.tar.bz2 |
gcc.c (add_sysrooted_prefix): Remove trailing dir separator from system root.
2012-01-27 Matthias Klose <doko@ubuntu.com>
* gcc.c (add_sysrooted_prefix): Remove trailing dir separator from
system root.
* incpath.c (add_standard_paths): Likewise.
From-SVN: r183591
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -2445,9 +2445,17 @@ add_sysrooted_prefix (struct path_prefix *pprefix, const char *prefix, if (target_system_root) { + char *sysroot_no_trailing_dir_separator = xstrdup (target_system_root); + size_t sysroot_len = strlen (target_system_root); + + if (sysroot_len > 0 + && target_system_root[sysroot_len - 1] == DIR_SEPARATOR) + sysroot_no_trailing_dir_separator[sysroot_len - 1] = '\0'; + if (target_sysroot_suffix) prefix = concat (target_sysroot_suffix, prefix, NULL); - prefix = concat (target_system_root, prefix, NULL); + prefix = concat (sysroot_no_trailing_dir_separator, prefix, NULL); + free (sysroot_no_trailing_dir_separator); /* We have to override this because GCC's notion of sysroot moves along with GCC. */ |