tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: make: avoid segfault on parse error

> -     if (*cfname != '/' && strcmp(cfname, "(stdin)") != 0) {
> +     if (*cfname != '/' && *cfname != '(') {

I question the correctness of this (either version, actually).  It
looks as though someone assumed no actual Makefile name would begin
with a left paren (or, in the older version, be "(stdin)").

Surely the right thing to do is to keep a flag variable alongside
cfname which says whether it's actually a file name or is an artificial
non-file name?

Of course, since all it does is produce a more verbose error message,
it probably isn't a big deal in this case, but I consider bad
precedents a Bad Thing....

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML      
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index