From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Blandy To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: compare strings carefully in gdbarch.sh Date: Thu, 07 Jun 2001 09:11:00 -0000 Message-id: References: <20010606181831.CDD365E9CB@zwingli.cygnus.com> <3B1F7C72.2010203@cygnus.com> X-SW-Source: 2001-06/msg00130.html Andrew Cagney writes: > > 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. Yes, I don't mean to assert that GNU test is the One True Test. But I think it's worth supporting, yes? > > 2001-06-06 Jim Blandy > > > > * 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. Thanks, I'll apply it.