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:
tg
2006-11-10 06:53:27 +00:00
parent b323a22b59
commit 35b30679c7
7 changed files with 37 additions and 46 deletions

13
sh.h
View File

@@ -8,7 +8,7 @@
/* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */
/* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.77 2006/11/10 06:45:28 tg Exp $"
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.78 2006/11/10 06:53:27 tg Exp $"
#define MKSH_VERSION "R29 2006/11/10"
#if HAVE_SYS_PARAM_H
@@ -99,12 +99,11 @@
} while (0)
#endif
#ifndef _tolower
#define _tolower(c) (((c) >= 'A') && ((c) <= 'Z') ? (c) - 'A' + 'a' : (c))
#endif
#ifndef _toupper
#define _toupper(c) (((c) >= 'a') && ((c) <= 'z') ? (c) - 'a' + 'A' : (c))
#endif
#define ksh_isdigit(c) (((c) >= '0') && ((c) <= '9'))
#define ksh_islower(c) (((c) >= 'a') && ((c) <= 'z'))
#define ksh_isupper(c) (((c) >= 'A') && ((c) <= 'Z'))
#define ksh_tolower(c) (((c) >= 'A') && ((c) <= 'Z') ? (c) - 'A' + 'a' : (c))
#define ksh_toupper(c) (((c) >= 'a') && ((c) <= 'z') ? (c) - 'a' + 'A' : (c))
#ifndef S_ISTXT
#define S_ISTXT 0001000