Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [bug?] test adf -ge 0
- X-seq: zsh-workers 20290
- From: Dan Nelson <dnelson@xxxxxxxxxxxxxxx>
- To: James William Pye <flaw@xxxxxxxx>
- Subject: Re: [bug?] test adf -ge 0
- Date: Tue, 31 Aug 2004 14:11:32 -0500
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <1093976533.69019.10.camel@localhost>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <1093976533.69019.10.camel@localhost>
In the last episode (Aug 31), James William Pye said:
> Using 4.2.0, why does this return successful?
Probably because atoi("sdf") returns 0, so the test succeeds.
> Both sh(freebsd) and bash echo an error message and return 2.
/bin/sh on Tru64 5.1, AIX 5.2, and Solaris 9 all succeed.
> I know zsh is not bash or sh, but this is a fairly serious
> inconsistency, IMO.
It's probably in the range of "undefined behaviour". I can't find any
manpages or standards docs that say that test must verify that numeric
arguments are really numbers.
--
Dan Nelson
dnelson@xxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author