oops, ctypes are indexed by ASCII value even on EBCDIC systems
This commit is contained in:
parent
d905bd16e1
commit
dba2efa290
4
sh.h
4
sh.h
@ -175,7 +175,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EXTERN
|
#ifdef EXTERN
|
||||||
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.826 2017/04/28 03:46:50 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.827 2017/04/28 03:51:13 tg Exp $");
|
||||||
#endif
|
#endif
|
||||||
#define MKSH_VERSION "R55 2017/04/27"
|
#define MKSH_VERSION "R55 2017/04/27"
|
||||||
|
|
||||||
@ -1489,7 +1489,7 @@ extern void ebcdic_init(void);
|
|||||||
#define ksh_eq(c,u,l) ((ord(c) | 0x20) == ord(l))
|
#define ksh_eq(c,u,l) ((ord(c) | 0x20) == ord(l))
|
||||||
#endif
|
#endif
|
||||||
/* new fast character classes */
|
/* new fast character classes */
|
||||||
#define ctype(c,t) tobool(ksh_ctypes[ord(c)] & (t))
|
#define ctype(c,t) tobool(ksh_ctypes[rtt2asc(c)] & (t))
|
||||||
/* helper functions */
|
/* helper functions */
|
||||||
#define ksh_isdash(s) tobool(ord((s)[0]) == '-' && ord((s)[1]) == '\0')
|
#define ksh_isdash(s) tobool(ord((s)[0]) == '-' && ord((s)[1]) == '\0')
|
||||||
/* invariant distance even in EBCDIC */
|
/* invariant distance even in EBCDIC */
|
||||||
|
4
shf.c
4
shf.c
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.87 2017/04/28 02:40:26 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.88 2017/04/28 03:51:14 tg Exp $");
|
||||||
|
|
||||||
/* flags to shf_emptybuf() */
|
/* flags to shf_emptybuf() */
|
||||||
#define EB_READSW 0x01 /* about to switch to reading */
|
#define EB_READSW 0x01 /* about to switch to reading */
|
||||||
@ -1214,7 +1214,7 @@ set_ifs(const char *s)
|
|||||||
memset(ksh_ctypes + sizeof(tpl_ctypes), '\0',
|
memset(ksh_ctypes + sizeof(tpl_ctypes), '\0',
|
||||||
sizeof(ksh_ctypes) - sizeof(tpl_ctypes));
|
sizeof(ksh_ctypes) - sizeof(tpl_ctypes));
|
||||||
while (*s)
|
while (*s)
|
||||||
ksh_ctypes[ord(*s++)] |= CiIFS;
|
ksh_ctypes[rtt2asc(*s++)] |= CiIFS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MKSH_EBCDIC
|
#ifdef MKSH_EBCDIC
|
||||||
|
Loading…
Reference in New Issue
Block a user