since so many internal things hardcode 'C' locale anyway,
use own is{digit,lower,upper} macros that go via byte ranges doesn't affect utf-8 hack because these only operate on single bytes anyway saves 224t
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/** $MirOS: src/bin/mksh/setmode.c,v 1.6 2006/11/09 22:51:49 tg Exp $ */
|
||||
/** $MirOS: src/bin/mksh/setmode.c,v 1.7 2006/11/10 06:53:27 tg Exp $ */
|
||||
/** _MirOS: src/lib/libc/gen/setmode.c,v 1.6 2006/11/08 23:18:04 tg Exp $ */
|
||||
/* $OpenBSD: setmode.c,v 1.17 2005/08/08 08:05:34 espie Exp $ */
|
||||
/* $NetBSD: setmode.c,v 1.15 1997/02/07 22:21:06 christos Exp $ */
|
||||
@ -58,7 +58,7 @@
|
||||
#endif
|
||||
|
||||
__SCCSID("@(#)setmode.c 8.2 (Berkeley) 3/25/94");
|
||||
__RCSID("$MirOS: src/bin/mksh/setmode.c,v 1.6 2006/11/09 22:51:49 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/setmode.c,v 1.7 2006/11/10 06:53:27 tg Exp $");
|
||||
|
||||
#define SET_LEN 6 /* initial # of bitcmd struct to malloc */
|
||||
#define SET_LEN_INCR 4 /* # of bitcmd structs to add as needed */
|
||||
@ -210,7 +210,7 @@ setmode(const char *p)
|
||||
* If an absolute number, get it and return; disallow non-octal digits
|
||||
* or illegal bits.
|
||||
*/
|
||||
if (isdigit((unsigned char)*p)) {
|
||||
if (ksh_isdigit((unsigned char)*p)) {
|
||||
perml = strtoul(p, &ep, 8);
|
||||
/* The test on perml will also catch overflow. */
|
||||
if (*ep != '\0' || (perml & ~(STANDARD_BITS|S_ISTXT))) {
|
||||
|
Reference in New Issue
Block a user