commit 74374cc8a40c450423785015c2e30d5a2ed2920c from: rsc date: Mon Oct 31 16:42:32 2005 UTC ctype sign fixes (Tom Miller) commit - b330c942b468ab82fd8853590145187e859258cb commit + 74374cc8a40c450423785015c2e30d5a2ed2920c blob - 85a57366411220da7022de70d1fda1014527fa6b blob + a7432f3316bfc36a464edd08721f0386b4c26d2f --- src/cmd/eqn/input.c +++ src/cmd/eqn/input.c @@ -189,9 +189,9 @@ input(void) ERROR "argfp underflow" FATAL; popsrc(); goto loop; - } else if (c == '$' && isdigit(*srcp->sp)) { + } else if (c == '$' && isdigit((uchar)*srcp->sp)) { int n = 0; - while (isdigit(*srcp->sp)) + while (isdigit((uchar)*srcp->sp)) n = 10 * n + *srcp->sp++ - '0'; if (n > 0 && n <= MAXARGS) pushsrc(String, argfp->argstk[n-1]); blob - 59bf3f20b4322d30a07a82a09b3a3747d3106e7e blob + 67d3dae8cbd1a37b6e30c68ed974b5d49733c9a6 --- src/cmd/eqn/size.c +++ src/cmd/eqn/size.c @@ -13,7 +13,7 @@ void setsize(char *p) /* set size as found in p */ ps -= atoi(p+1); if (szstack[nszstack-1] != 0) szstack[nszstack] = ps; - } else if (isdigit(*p)) { + } else if (isdigit((uchar)*p)) { if (szstack[nszstack-1] == 0) printf(".nr %d \\n(.s\n", 99-nszstack); else @@ -52,7 +52,7 @@ void globsize(void) gsize -= atoi(temp+1); if (szstack[0] != 0) szstack[0] = gsize; - } else if (isdigit(temp[0])) { + } else if (isdigit((uchar)temp[0])) { gsize = atoi(temp); szstack[0] = gsize; printf(".nr 99 \\n(.s\n"); blob - 1e90cb9afaf3dc53f94a82fc7f622bd6dce27230 blob + 509fb01b8933ac30c85ba9fcce926063535ebfdd --- src/cmd/grap/input.c +++ src/cmd/grap/input.c @@ -277,9 +277,9 @@ nextchar(void) ERROR "argfp underflow" FATAL; popsrc(); goto loop; - } else if (c == '$' && isdigit(*srcp->sp)) { /* $3 */ + } else if (c == '$' && isdigit((uchar)*srcp->sp)) { /* $3 */ int n = 0; - while (isdigit(*srcp->sp)) + while (isdigit((uchar)*srcp->sp)) n = 10 * n + *srcp->sp++ - '0'; if (n > 0 && n <= MAXARGS) pushsrc(String, argfp->argstk[n-1]); @@ -456,11 +456,11 @@ void eprint(void) /* try to print context around error for (q=ep-1; q>=p && *q!=' ' && *q!='\t' && *q!='\n'; q--) ; for (; p < q; p++) - if (isprint(*p)) + if (isprint((uchar)*p)) putc(*p, stderr); fprintf(stderr, " >>> "); for (; p < q; p++) - if (isprint(*p)) + if (isprint((uchar)*p)) putc(*p, stderr); fprintf(stderr, " <<< "); while (pb >= pbuf) blob - 1ce32116ebb611da0c2e40e0036028f4ec0fa808 blob + 5a2e4e789756d523dc05f85fdd9431488aa05f06 --- src/cmd/grap/print.c +++ src/cmd/grap/print.c @@ -147,7 +147,7 @@ void graph(char *s) /* graph statement */ s++; if (c == '\0') ERROR "no name on graph statement" WARNING; - if (!isupper(s[0])) + if (!isupper((uchar)s[0])) ERROR "graph name %s must be capitalized", s WARNING; for (p=graphname; (c = *s) != ' ' && c != '\t' && c != '\0'; ) *p++ = *s++; blob - 07aa565f9c84b0ac6face1c1b5aeb7f49eef8f1a blob + 9955b3fd9c9eda9e0399555119cc11f4694a6299 --- src/cmd/mk/archive.c +++ src/cmd/mk/archive.c @@ -171,7 +171,7 @@ atimes(char *ar) continue; } goto skip; - }else if(strings && h.name[0]=='/' && isdigit(h.name[1])){ + }else if(strings && h.name[0]=='/' && isdigit((uchar)h.name[1])){ i = strtol(h.name+1, &p, 10); if(*p != ' ' || i >= strlen(strings)) goto skip; blob - d73595d2614c113977806f2d5b7e82ff3b544ff7 blob + 8613955b205dc44448171f36128773b1c02adda0 --- src/cmd/mk/rule.c +++ src/cmd/mk/rule.c @@ -83,6 +83,7 @@ dumpr(char *s, Rule *r) Bprint(&bout, " prog='%s'", r->prog); Bprint(&bout, "\n\ttarget=%s: %s\n", r->target, wtos(r->tail, ' ')); Bprint(&bout, "\trecipe@%ld='%s'\n", r->recipe, r->recipe); +break; } } blob - aca58f0e3e02258fc82250c829145f4b9ee20c17 blob + 28120ea5d8fa9ed24ae39a68ad67258680067c52 --- src/cmd/postscript/common/misc.c +++ src/cmd/postscript/common/misc.c @@ -4,6 +4,7 @@ * */ +#include #include #include #include @@ -170,10 +171,10 @@ str_convert(str, err) * */ - if ( ! isdigit(**str) ) + if ( ! isdigit((uchar)**str) ) return(err); - for ( i = 0; isdigit(**str); *str += 1 ) + for ( i = 0; isdigit((uchar)**str); *str += 1 ) i = 10 * i + **str - '0'; return(i); blob - 59f74ec8770d920d69c78b9020ebaf9e12f69b20 blob + 9c1845b045e5cad9c766a37e02b81578a8805df7 --- src/cmd/troff/dwbinit.c +++ src/cmd/troff/dwbinit.c @@ -73,6 +73,7 @@ * */ +#include #include #include #include @@ -169,10 +170,10 @@ char *DWBhome(void) if ( (fp = fopen(DWBCONFIG, "r")) != NULL ) { len = strlen(DWBENV); while ( fgets(buf, sizeof(buf), fp) != NULL ) { - for ( ptr = buf; isspace(*ptr); ptr++ ) ; + for ( ptr = buf; isspace((uchar)*ptr); ptr++ ) ; if ( strncmp(ptr, DWBENV, len) == 0 && *(ptr+len) == '=' ) { path = ptr + len + 1; - for ( ptr = path; !isspace(*ptr) && *ptr != ';'; ptr++ ) ; + for ( ptr = path; !isspace((uchar)*ptr) && *ptr != ';'; ptr++ ) ; *ptr = '\0'; if ( home != NULL ) free(home); blob - 7fe87b63dabab10d9fc9b3a8996106c28259f870 blob + 4c2bec4b3c6afa410c22221c26f59627239c0b37 --- src/cmd/troff/n1.c +++ src/cmd/troff/n1.c @@ -5,6 +5,7 @@ * input routines, escape function calling */ +#include #include "tdef.h" #include "fns.h" #include "ext.h" @@ -1091,10 +1092,10 @@ void getpn(char *a) continue; default: n = 0; - if (isdigit(*a)) { + if (isdigit((uchar)*a)) { do n = 10 * n + *a++ - '0'; - while (isdigit(*a)); + while (isdigit((uchar)*a)); a--; } else n = 9999; blob - ded45438bff191a02525561911d47012ed72e9a2 blob + b2ab175b3516ceeed9377659266b326f5bc2b26e --- src/cmd/troff/n8.c +++ src/cmd/troff/n8.c @@ -1,3 +1,4 @@ +#include #include "tdef.h" #include "fns.h" #include "ext.h" @@ -495,7 +496,7 @@ static void install(char *s) /* map ab4c5de to: 12 abc num[0] = '0'; *nextpat++ = ' '; /* fill in with count later */ for (npat = lastpat = 0; *s != '\n' && *s != '\0'; s++) { - if (isdigit(*s)) { + if (isdigit((uchar)*s)) { num[npat] = *s; lastpat = npat; } else {