head 1.8; access; symbols; locks; strict; comment @ * @; 1.8 date 92.12.15.00.20.22; author jromine; state Exp; branches; next 1.7; 1.7 date 92.10.26.22.56.12; author jromine; state Exp; branches; next 1.6; 1.6 date 90.04.05.15.30.35; author sources; state Exp; branches; next 1.5; 1.5 date 90.04.05.14.44.33; author sources; state Exp; branches; next 1.4; 1.4 date 90.04.02.15.07.22; author sources; state Exp; branches; next 1.3; 1.3 date 90.04.02.14.40.31; author sources; state Exp; branches; next 1.2; 1.2 date 90.01.25.16.09.17; author sources; state Exp; branches; next 1.1; 1.1 date 90.01.25.16.07.24; author sources; state Exp; branches; next ; desc @@ 1.8 log @endif sugar @ text @/* uprf.c - "unsigned" lexical prefix */ #ifndef lint static char ident[] = "@@(#)$Id: uprf.c,v 1.7 1992/10/26 22:56:12 jromine Exp jromine $"; #endif /* lint */ #define TO_LOWER 040 #define NO_MASK 000 #include uprf (c1, c2) register char *c1, *c2; { register int c, mask; if (c1 == 0 || c2 == 0) return(0); /* XXX */ while (c = *c2++) { #ifdef LOCALE c &= 0xff; mask = *c1 & 0xff; c = (isalpha(c) && isupper(c)) ? tolower(c) : c; mask = (isalpha(mask) && isupper(mask)) ? tolower(mask) : mask; if (c != mask) #else mask = (isalpha(c) && isalpha(*c1)) ? TO_LOWER : NO_MASK; if ((c | mask) != (*c1 | mask)) #endif return 0; else c1++; } return 1; } @ 1.7 log @LOCALE @ text @d3 2 a4 2 static char ident[] = "@@(#)$Id: uprf.c,v 1.6 1990/04/05 15:30:35 sources Exp jromine $"; #endif lint @ 1.6 log @add ID @ text @d3 1 a3 1 static char ident[] = "@@(#)$Id:$"; d22 7 d31 1 @ 1.5 log @add ID @ text @d3 1 a3 1 static char ident[] = "$Id:"; @ 1.4 log @typo @ text @d2 3 @ 1.3 log @RAND fixes @ text @d3 1 a3 1 #define TO_UPPER 040 d11 2 a12 1 register int c; d19 1 a19 1 mask = (isalpha(c) && isalpha(*c1)) ? TO_UPPER : NO_MASK; @ 1.2 log @fix null pointer bug. @ text @d3 3 d17 3 a19 1 if ((c | 040) != (*c1 | 040)) d23 1 a23 1 @ 1.1 log @Initial revision @ text @d10 3 @