also get back octal crap for LEGACY KSH
This commit is contained in:
parent
1f5c10c8b6
commit
5386859b3f
12
check.t
12
check.t
@ -1,4 +1,4 @@
|
|||||||
# $MirOS: src/bin/mksh/check.t,v 1.540 2012/06/25 16:17:51 tg Exp $
|
# $MirOS: src/bin/mksh/check.t,v 1.541 2012/06/25 16:31:16 tg Exp $
|
||||||
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
|
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
|
||||||
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
|
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
|
||||||
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
|
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
|
||||||
@ -3653,11 +3653,21 @@ name: integer-base-check-flat
|
|||||||
description:
|
description:
|
||||||
Check behaviour does not match POSuX, because a not type-safe
|
Check behaviour does not match POSuX, because a not type-safe
|
||||||
scripting language has *no* business interpreting "010" as octal
|
scripting language has *no* business interpreting "010" as octal
|
||||||
|
category: shell:legacy-no
|
||||||
stdin:
|
stdin:
|
||||||
echo :$((10)).$((010)).$((0x10)).
|
echo :$((10)).$((010)).$((0x10)).
|
||||||
expected-stdout:
|
expected-stdout:
|
||||||
:10.10.16.
|
:10.10.16.
|
||||||
---
|
---
|
||||||
|
name: integer-base-check-flat-legacy
|
||||||
|
description:
|
||||||
|
Check behaviour matches POSuX for LEGACY KSH
|
||||||
|
category: shell:legacy-yes
|
||||||
|
stdin:
|
||||||
|
echo :$((10)).$((010)).$((0x10)).
|
||||||
|
expected-stdout:
|
||||||
|
:10.8.16.
|
||||||
|
---
|
||||||
name: integer-base-check-numeric-from
|
name: integer-base-check-numeric-from
|
||||||
description:
|
description:
|
||||||
Check behaviour for base one to 36, and that 37 errors out
|
Check behaviour for base one to 36, and that 37 errors out
|
||||||
|
10
var.c
10
var.c
@ -27,7 +27,7 @@
|
|||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.149 2012/05/09 23:21:00 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.150 2012/06/25 16:31:18 tg Exp $");
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Variables
|
* Variables
|
||||||
@ -493,6 +493,14 @@ getint(struct tbl *vp, mksh_ari_t *nump, bool arith)
|
|||||||
base = 16;
|
base = 16;
|
||||||
have_base = true;
|
have_base = true;
|
||||||
}
|
}
|
||||||
|
#ifdef MKSH_LEGACY_MODE
|
||||||
|
if (arith && s[0] == '0' && ksh_isdigit(s[1]) &&
|
||||||
|
!(vp->flag & ZEROFIL)) {
|
||||||
|
/* interpret as octal (deprecated) */
|
||||||
|
base = 8;
|
||||||
|
have_base = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
while ((c = *s++)) {
|
while ((c = *s++)) {
|
||||||
if (c == '-') {
|
if (c == '-') {
|
||||||
neg++;
|
neg++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user