This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RFA: compare strings carefully in gdbarch.sh


> 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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]