be really loud when doing unwise things that WILL break in R41
This commit is contained in:
parent
e83e43aaa5
commit
f9d644e243
18
check.t
18
check.t
@ -1,4 +1,4 @@
|
||||
# $MirOS: src/bin/mksh/check.t,v 1.518 2012/03/23 23:25:23 tg Exp $
|
||||
# $MirOS: src/bin/mksh/check.t,v 1.519 2012/03/24 19:13:25 tg 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: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
|
||||
@ -3416,6 +3416,7 @@ expected-stdout:
|
||||
name: integer-base-err-1
|
||||
description:
|
||||
Can't have 0 base (causes shell to exit)
|
||||
category: nodeprecated
|
||||
expected-exit: e != 0
|
||||
stdin:
|
||||
typeset -i i
|
||||
@ -3425,6 +3426,19 @@ stdin:
|
||||
expected-stderr-pattern:
|
||||
/^.*:.*0#4.*\n$/
|
||||
---
|
||||
name: integer-base-err-1-deprecated
|
||||
description:
|
||||
Can't have 0 base (causes shell to exit)
|
||||
category: !nodeprecated
|
||||
expected-exit: e != 0
|
||||
stdin:
|
||||
typeset -i i
|
||||
i=3
|
||||
i=0#4
|
||||
echo $i
|
||||
expected-stderr-pattern:
|
||||
/^.*octal is deprecated\n.*:.*0#4.*\n$/
|
||||
---
|
||||
name: integer-base-err-2
|
||||
description:
|
||||
Can't have multiple bases in a 'constant' (causes shell to exit)
|
||||
@ -3628,6 +3642,8 @@ stdin:
|
||||
echo :$((10)).$((010)).$((0x10)).
|
||||
expected-stdout:
|
||||
:10.8.16.
|
||||
expected-stderr-pattern:
|
||||
/octal is deprecated/
|
||||
---
|
||||
name: integer-base-check-flat-right
|
||||
description:
|
||||
|
8
var.c
8
var.c
@ -27,7 +27,7 @@
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.143 2012/03/23 23:25:30 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.144 2012/03/24 19:13:27 tg Exp $");
|
||||
|
||||
/*-
|
||||
* Variables
|
||||
@ -503,8 +503,12 @@ getint(struct tbl *vp, mksh_ari_t *nump, bool arith)
|
||||
} else if (vp->flag & ZEROFIL) {
|
||||
while (*s == '0')
|
||||
s++;
|
||||
} else
|
||||
} else {
|
||||
warningf(true, "interpreting %s[%lu]='%s' as octal"
|
||||
" is deprecated", vp->name,
|
||||
arrayindex(vp), vp->val.s + vp->type);
|
||||
base = 8;
|
||||
}
|
||||
have_base = true;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user