reimplement truncate() to make it optimal.
[oota-llvm.git] / lib / Support / regcomp.c
index 9ae66f3fa5ff290df3b30f4495676bcddcde2653..46c91a9c497cda8cdc7ccf8fb73df0441fb7bd83 100644 (file)
@@ -142,6 +142,7 @@ static char nuls[10];               /* place to point scanner in event of error */
 #else
 #define        DUPMAX  255
 #endif
+#define        INFINITY        (DUPMAX + 1)
 
 #ifndef NDEBUG
 static int never = 0;          /* for use in asserts; shuts lint up */
@@ -256,8 +257,8 @@ static void
 p_ere(struct parse *p, int stop)       /* character this ERE should end at */
 {
        char c;
-       sopno prevback;
-       sopno prevfwd;
+       sopno prevback = 0;
+       sopno prevfwd = 0;
        sopno conc;
        int first = 1;          /* is this the first alternative? */
 
@@ -779,7 +780,7 @@ p_b_cclass(struct parse *p, cset *cs)
        const char *u;
        char c;
 
-       while (MORE() && isalpha(PEEK()))
+       while (MORE() && isalpha((uch)PEEK()))
                NEXT();
        len = p->next - sp;
        for (cp = cclasses; cp->name != NULL; cp++)