On 11/05/15 15:29, Lennart Sorensen wrote:
On Mon, May 11, 2015 at 02:57:51PM +0200, Andreas Färber wrote:
Am 10.05.2015 um 23:37 schrieb Tarl Neustaedter:
On 2015-May-10 17:08 , Programmingkid wrote: [...]
What advantage does the code "if [ x"$CROSS_COMPILE" != "x" ];" have over "if [ "$CROSS_COMPILE" ];"?
I don't believe the latter form worked on the early versions of sh/test, there might still be systems where if [""]; produces a syntax error.
Is 'if [ -z "$CROSS_COMPILE" ]' (untested) any more compatible?
Yes, but checks for empty rather than non empty.
FWIW I used the "if [ x"$CROSS_COMPILE" != "x" ];" version because that's the existing convention used within the file to detect empty variables and I'd like to keep everything consistent.
ATB,
Mark.