From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [128.61.1.1]) by werple.mira.net.au (8.6.10/8.6.9) with SMTP id DAA06579 for ; Tue, 23 May 1995 03:46:17 +1000 Received: from math (math.skiles.gatech.edu) by gatech.edu with SMTP id AA08782 (5.65c/Gatech-10.0-IDA for ); Mon, 22 May 1995 13:43:13 -0400 Received: by math (5.x/SMI-SVR4) id AA02089; Mon, 22 May 1995 13:40:31 -0400 Resent-Date: Mon, 22 May 1995 19:39:54 +0100 (MET DST) Old-Return-Path: From: hzoli@cs.elte.hu (Zoltan Hidvegi) Message-Id: <9505221739.AA04229@turan.elte.hu> Subject: Re: intepreting octal and globbing breakage To: coleman@math.gatech.edu (Richard Coleman) Date: Mon, 22 May 1995 19:39:54 +0100 (MET DST) Cc: zsh-workers@math.gatech.edu (zsh-workers) In-Reply-To: <9505221651.AA23094@redwood.skiles.gatech.edu> from "Richard Coleman" at May 22, 95 12:51:06 pm X-Mailer: ELM [version 2.4 PL21] Content-Type: text Resent-Message-Id: <"figE_.0.VW.EoCml"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/18 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > That's one of the reasons I just made a test release rather than the > real thing. I'll probably have to go back using zstrtol. That would > also make it easy to fix it so that numbers beginning with '0' are not > interpreted as octal. I sorta hate to do this, since then zstrtol > would be even more incompatible with the standard strtol. I also hate Why? It can be compatible with the standard, but we should call it with base 10 from zzlex. > the idea of interpreting 0xff has hex, but not interpreting 010 as > octal. I also hate the idea of adding (yet another) option to control > this. > > What does ksh and bash do? I'm inclined to go with the principle of > least surprise and make this compatible with however the other shells > handle this. Bash version 1.14.3 always treat 010 az octal and 0xff as hex in math, and it segfaults on echo $[09] (at least with Solaris 2.3) :-). ksh ignores leading zeros. I see that interpreting 0xff as hex but 010 as decimal is not too elegant, but it does not hurt anyone. The alternative is to give unballanced stack error on 0xff and if I have to choose I'd choose 0xff to be a hex number. It can be done in zzlex. Zoltan