summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai2000-08-28 03:12:30 +0000
committerMatt Kraai2000-08-28 03:12:30 +0000
commitab60f6987a8283f60988c7e7806bd7fbfd86fbd3 (patch)
treef3df79cd432fd69d4d4d92833062c6b069a6194c
parent88cc3057fdb5a342bc305963cd6abc180ff6c324 (diff)
downloadbusybox-ab60f6987a8283f60988c7e7806bd7fbfd86fbd3.zip
busybox-ab60f6987a8283f60988c7e7806bd7fbfd86fbd3.tar.gz
Removed dead regular expression code.
-rw-r--r--busybox.def.h10
-rw-r--r--utility.c76
2 files changed, 0 insertions, 86 deletions
diff --git a/busybox.def.h b/busybox.def.h
index 63b8306..c85f1ee 100644
--- a/busybox.def.h
+++ b/busybox.def.h
@@ -139,12 +139,6 @@
// at the same time...
#define BB_FEATURE_USE_PROCFS
//
-// Enable full regular expressions. This adds about
-// 4k. When this is off, things that would normally
-// use regualr expressions (like grep) will just use
-// normal strings.
-#define BB_FEATURE_FULL_REGULAR_EXPRESSIONS
-//
// This compiles out everything but the most
// trivial --help usage information (i.e. reduces binary size)
//#define BB_FEATURE_TRIVIAL_HELP
@@ -281,10 +275,6 @@
#define BB_MTAB
#endif
//
-#if defined BB_FEATURE_FULL_REGULAR_EXPRESSIONS && (defined BB_SED || defined BB_GREP )
-#define BB_REGEXP
-#endif
-//
#if defined BB_FEATURE_SH_COMMAND_EDITING && defined BB_SH
#define BB_CMDEDIT
#endif
diff --git a/utility.c b/utility.c
index aa8bef6..911d84e 100644
--- a/utility.c
+++ b/utility.c
@@ -1033,82 +1033,6 @@ int get_console_fd(char *tty_name)
#endif /* BB_CHVT || BB_DEALLOCVT || BB_SETKEYCODES */
-#if !defined BB_REGEXP && (defined BB_GREP || defined BB_SED)
-
-/* Do a case insensitive strstr() */
-char *stristr(char *haystack, const char *needle)
-{
- int len = strlen(needle);
-
- while (*haystack) {
- if (!strncasecmp(haystack, needle, len))
- break;
- haystack++;
- }
-
- if (!(*haystack))
- haystack = NULL;
-
- return haystack;
-}
-
-/* This tries to find a needle in a haystack, but does so by
- * only trying to match literal strings (look 'ma, no regexps!)
- * This is short, sweet, and carries _very_ little baggage,
- * unlike its beefier cousin in regexp.c
- * -Erik Andersen
- */
-extern int find_match(char *haystack, char *needle, int ignoreCase)
-{
-
- if (ignoreCase == FALSE)
- haystack = strstr(haystack, needle);
- else
- haystack = stristr(haystack, needle);
- if (haystack == NULL)
- return FALSE;
- return TRUE;
-}
-
-
-/* This performs substitutions after a string match has been found. */
-extern int replace_match(char *haystack, char *needle, char *newNeedle,
- int ignoreCase)
-{
- int foundOne = 0;
- char *where, *slider, *slider1, *oldhayStack;
-
- if (ignoreCase == FALSE)
- where = strstr(haystack, needle);
- else
- where = stristr(haystack, needle);
-
- if (strcmp(needle, newNeedle) == 0)
- return FALSE;
-
- oldhayStack = (char *) xmalloc((unsigned) (strlen(haystack)));
- while (where != NULL) {
- foundOne++;
- strcpy(oldhayStack, haystack);
- for (slider = haystack, slider1 = oldhayStack; slider != where;
- slider++, slider1++);
- *slider = 0;
- haystack = strcat(haystack, newNeedle);
- slider1 += strlen(needle);
- haystack = strcat(haystack, slider1);
- where = strstr(slider, needle);
- }
- free(oldhayStack);
-
- if (foundOne > 0)
- return TRUE;
- else
- return FALSE;
-}
-
-#endif /* ! BB_REGEXP && (BB_GREP || BB_SED) */
-
-
#if defined BB_FIND || defined BB_INSMOD
/*
* Routine to see if a text string is matched by a wildcard pattern.