Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/usr.bin/make
On Fri, 12 Oct 2007, David Laight wrote:
> Modified Files:
> src/usr.bin/make: job.c
>
> Log Message:
> Var_Subst() seems to write into its input string! So we do need a copy.
In this particular case, Var_Subst (at line 3668) calls Var_Parse, which
blows up at line 3330.
var.c is littered with uses of the WR() macro to write into const
strings. This usually seems to be for the purpose of temporarily
changing a delimiter character to \0', and restoring the original
character later.
It looks easy enough to change the code to use strdup()/free() to make
the changes to a temporary copy of the string. It should also be
possible to avoid either copying the string or writing to the string,
by using extra counters or pointers to keep track of the substrings of
interest.
--apb (Alan Barrett)
Home |
Main Index |
Thread Index |
Old Index