EBCDIC helpers and OS/390 signals

This commit is contained in:
tg
2015-04-29 18:38:54 +00:00
parent c3efd2abb2
commit 2cb0ea982a
4 changed files with 15 additions and 14 deletions

14
var.c
View File

@ -28,7 +28,7 @@
#include <sys/sysctl.h>
#endif
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.190 2015/04/19 18:50:38 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.191 2015/04/29 18:38:54 tg Exp $");
/*-
* Variables
@ -510,7 +510,7 @@ getint(struct tbl *vp, mksh_ari_u *nump, bool arith)
}
if (c == '0' && arith) {
if ((s[0] | 0x20) == 'x') {
if (ksh_eq(s[0], 'X', 'x')) {
/* interpret as hexadecimal */
base = 16;
++s;
@ -554,12 +554,12 @@ getint(struct tbl *vp, mksh_ari_u *nump, bool arith)
}
if (ksh_isdigit(c))
c -= '0';
else {
c |= 0x20;
if (!ksh_islower(c))
return (-1);
else if (ksh_isupper(c))
c -= 'A' - 10;
else if (ksh_islower(c))
c -= 'a' - 10;
}
else
return (-1);
if (c >= base)
return (-1);
/* handle overflow as truncation */