[patch]: Make sure that $ characters are prefixed by backslash

Alan Modra amodra@bigpond.net.au
Mon Jan 5 11:31:00 GMT 2009


On Mon, Jan 05, 2009 at 09:12:28AM +0100, Andreas Schwab wrote:
> Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu> writes:
> 
> > On Sun, 4 Jan 2009, Dave Korn wrote:
> >
> >> Kai Tietz wrote:
> >>>
> >>> Thanks for catching this.
> >>> Updated patch ok for apply?
> >>
> >>  Also, I think you don't need to escape the ones inside single-quotes:
> >>
> >> @@ -1636,7 +1636,7 @@ gld_${EMULATION_NAME}_place_orphan (asec
> >>
> >>   /* Look through the script to see where to place this section.  */
> >>   if (!link_info.relocatable
> >> -      && (dollar = strchr (secname, '$')) != NULL)
> >> +      && (dollar = strchr (secname, '\$')) != NULL)
> >
> > I'm pretty sure that, in C, a dollar sign may not be escaped by a slash.
> 
> This is part of a big (unquoted) sh here document.

That's right.  Backslash itself also ought to be quoted.  Bash seems
to be quite forgiving.

The patch is OK to apply.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list