* use only macros for ctype stuff any more

XXX one of these uses a gcc extension, ok for now tho
* don't include <ctype.h> any more at all
* don't try nl_langinfo in small mode, just check locale

saves 171 .text, 4 .data, 256 .bss, 1 import
This commit is contained in:
tg
2006-11-10 07:18:58 +00:00
parent 35b30679c7
commit feb7dddd44
7 changed files with 68 additions and 49 deletions

10
var.c
View File

@ -2,7 +2,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.29 2006/11/10 06:53:27 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.30 2006/11/10 07:18:58 tg Exp $");
/*
* Variables
@ -505,7 +505,7 @@ formatstr(struct tbl *vp, const char *s)
if (vp->flag & RJUST) {
const char *qq = s + olen;
/* strip trailing spaces (at&t uses qq[-1] == ' ') */
while (qq > s && isspace((unsigned char)qq[-1]))
while (qq > s && ksh_isspace(qq[-1]))
--qq;
slen = qq - s;
if (slen > vp->u2.field) {
@ -520,7 +520,7 @@ formatstr(struct tbl *vp, const char *s)
"%.*s", slen, s);
} else {
/* strip leading spaces/zeros */
while (isspace((unsigned char)*s))
while (ksh_isspace(*s))
s++;
if (vp->flag & ZEROFIL)
while (*s == '0')
@ -533,10 +533,10 @@ formatstr(struct tbl *vp, const char *s)
if (vp->flag & UCASEV_AL) {
for (q = p; *q; q++)
*q = _toupper((unsigned char)*q);
*q = ksh_toupper(*q);
} else if (vp->flag & LCASEV) {
for (q = p; *q; q++)
*q = _tolower((unsigned char)*q);
*q = ksh_tolower(*q);
}
return p;