This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [google/gcc-4_7] Fix problem with asm spec for -gsplit-dwarf


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]