RFA: compare strings carefully in gdbarch.sh
Andrew Cagney
ac131313@cygnus.com
Thu Jun 7 07:29:00 GMT 2001
> Isn't that amazing? If it's the only thing there, then `[' knows it's
> not a unary operator, and apparently applies the "true if string not
> null" interpretation to it. But if it's followed by something, then
> it assumes it's an operator.
$ [ -1 ] && echo "hi"
hi
$ [ -1 -a -2 ] && echo "hi"
hi
It's more of a compatibility issue. The script works on Solaris and *BSD.
> 2001-06-06 Jim Blandy <jimb@redhat.com>
>
> * gdbarch.sh: Make sure that '[' doesn't interpret interesting
> variable values as operators.
Yes, ok. Doug Evans posted a similar patch but that one had massive
offsets so I dropped it.
Andrew
More information about the Gdb-patches
mailing list