This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[google/gcc-4_7] Fix problem with asm spec for -gsplit-dwarf
- From: ccoutant at google dot com (Cary Coutant)
- To: gcc-patches at gcc dot gnu dot org, saugustine at google dot com
- Date: Wed, 12 Sep 2012 16:18:50 -0700 (PDT)
- Subject: [google/gcc-4_7] Fix problem with asm spec for -gsplit-dwarf
2012-09-12 Cary Coutant <ccoutant@google.com>
gcc/
* gcc.c (replace_extension_spec_func): Restrict search for
extension to last component of path.
Index: gcc/gcc.c
===================================================================
--- gcc/gcc.c (revision 191233)
+++ gcc/gcc.c (working copy)
@@ -8413,12 +8413,18 @@ replace_extension_spec_func (int argc, c
char *name;
char *p;
char *result;
+ int i;
if (argc != 2)
fatal_error ("too few arguments to %%:replace-extension");
name = xstrdup (argv[0]);
- p = strrchr (name, '.');
+
+ for (i = strlen(name) - 1; i >= 0; i--)
+ if (IS_DIR_SEPARATOR (name[i]))
+ break;
+
+ p = strrchr (name + i + 1, '.');
if (p != NULL)
*p = '\0';