making note of my changes.
[oweals/busybox.git] / regexp.c
index 9f9b5c28c0fa1c8e87d0a9b3f1f365cf173019a0..11b46c72029677cc1788ffa4a742455172a3ae89 100644 (file)
--- a/regexp.c
+++ b/regexp.c
@@ -7,7 +7,7 @@
 #include <ctype.h>
 
 
-#if ( defined BB_GREP || defined BB_FIND  || defined BB_SED)
+#if ( defined BB_GREP || defined BB_SED)
 
 /* This also tries to find a needle in a haystack, but uses
  * real regular expressions....  The fake regular expression
@@ -98,7 +98,9 @@ extern int replace_match(char *haystack, char *needle, char *newNeedle, int igno
 
 
 static char *previous; /* the previous regexp, used when null regexp is given */
+#if defined BB_SED
 static char *previous1;        /* a copy of the text from the previous substitution for regsub()*/
+#endif
 
 
 /* These are used to classify or recognize meta-characters */
@@ -383,11 +385,14 @@ static int match1(regexp* re, char ch, int token, int ignoreCase)
                if (re->program[1 + 32 * (token - M_CLASS(0)) + (ch >> 3)] & (1 << (ch & 7)))
                        return 0;
        }
-       else if (ch == token
-               || (ignoreCase==TRUE && isupper(ch) && tolower(ch) == token))
+//fprintf(stderr, "match1: ch='%c' token='%c': ", ch, token);
+       if (ch == token
+               || (ignoreCase==TRUE && tolower(ch) == tolower(token)))
        {
+//fprintf(stderr, "match\n");
                return 0;
        }
+//fprintf(stderr, "no match\n");
        return 1;
 }