This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [google/gcc-4_7] Fix problem with asm spec for -gsplit-dwarf
- From: Sterling Augustine <saugustine at google dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 12 Sep 2012 16:22:54 -0700
- Subject: Re: [google/gcc-4_7] Fix problem with asm spec for -gsplit-dwarf
- References: <20120912231850.998DFE0C81@ccoutant.mtv.corp.google.com>
On Wed, Sep 12, 2012 at 4:18 PM, Cary Coutant <ccoutant@google.com> wrote:
> 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';
>
This is OK for Google 4.7.
Sterling