This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: compare strings carefully in gdbarch.sh
- To: Jim Blandy <jimb at cygnus dot com>
- Subject: Re: RFA: compare strings carefully in gdbarch.sh
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Thu, 07 Jun 2001 09:06:58 -0400
- Cc: gdb-patches at sources dot redhat dot com
- References: <20010606181831.CDD365E9CB@zwingli.cygnus.com>
> 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