* zsh-2.6-beta18: an incompatibility with ksh in typeset command
@ 1996-05-24 8:11 SUZUKI Hisao
0 siblings, 0 replies; only message in thread
From: SUZUKI Hisao @ 1996-05-24 8:11 UTC (permalink / raw)
To: zsh-workers
This is a report on the problem which I had noticed in
zsh-2.6-beta16 and had sent you a bug-report on the 9th May.
But it seems that no improvement had done for now. Maybe my
report had lost somewhere no one knows... So, I decided to
report it again. (Excuse me if this is a redundant report.)
The problem I found is a slight incompatibility between the
Z Shell and the Korn Shell (ksh, hereafter).
In ksh, the optional numeric argument of `typeset' command,
which is typically used to specify the output arithmetic base,
is placed just after the option(s) of the command:
$ typeset -i2 a
$ a=10
$ echo $a
2#1010
$
In zsh-2.6-beta18, however, you must put a space between the
option and numeric argument, like this:
% typeset -i 2 a
This is an annoying difference.
The following is a sample fix; it preserves the backward
compatibility by extending only the erroneous case, though it is
quick-and-dirty...
*** builtin.c.orig Tue May 21 18:00:23 1996
--- builtin.c Fri May 24 06:24:16 1996
***************
*** 125,133 ****
break;
/* the above loop may have exited on an invalid option */
if (*arg) {
! zerr("bad option: %c", NULL, *arg);
! zsfree(xarg);
! return 1;
}
/* handle the special "set" options */
arg = (char *) ugetnode(args);
--- 125,142 ----
break;
/* the above loop may have exited on an invalid option */
if (*arg) {
! /* "typeset" may take a numeric argument at the tail of the
! options */
! if (idigit(*arg) && (flags & BINF_TYPEOPT)) {
! char* endPtr;
! auxlen = (int)strtol(arg, &endPtr, 10);
! arg = endPtr;
! }
! if (*arg) {
! zerr("bad option: %c", NULL, *arg);
! zsfree(xarg);
! return 1;
! }
}
/* handle the special "set" options */
arg = (char *) ugetnode(args);
SUZUKI Hisao # `Begin at the beginning and go on till
suzuki@otsl.oki.co.jp # you come to the end: then stop.'
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1996-05-24 8:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-05-24 8:11 zsh-2.6-beta18: an incompatibility with ksh in typeset command SUZUKI Hisao
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).