diff --git a/NEWS b/NEWS index fdad83c..1af3def 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ GNU grep NEWS -*- outline -*- * Noteworthy changes in release ?.? (????-??-??) [?] +** Improvements + + Performance has improved for very long strings in patterns. + * Noteworthy changes in release 2.20 (2014-06-03) [stable] diff --git a/bootstrap.conf b/bootstrap.conf index 9f3457d..1ab730d 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -77,6 +77,7 @@ stdlib stpcpy strerror string +strstr strtoull strtoumax sys_stat diff --git a/src/dfa.c b/src/dfa.c index 48a83cd..522a027 100644 --- a/src/dfa.c +++ b/src/dfa.c @@ -3752,19 +3752,6 @@ icatalloc (char *old, char const *new) return result; } -static char *_GL_ATTRIBUTE_PURE -istrstr (char const *lookin, char const *lookfor) -{ - char const *cp; - size_t len; - - len = strlen (lookfor); - for (cp = lookin; *cp != '\0'; ++cp) - if (strncmp (cp, lookfor, len) == 0) - return (char *) cp; - return NULL; -} - static void freelist (char **cpp) { @@ -3780,7 +3767,7 @@ enlist (char **cpp, char *new, size_t len) new[len] = '\0'; /* Is there already something in the list that's new (or longer)? */ for (i = 0; cpp[i] != NULL; ++i) - if (istrstr (cpp[i], new) != NULL) + if (strstr (cpp[i], new) != NULL) { free (new); return cpp; @@ -3788,7 +3775,7 @@ enlist (char **cpp, char *new, size_t len) /* Eliminate any obsoleted strings. */ j = 0; while (cpp[j] != NULL) - if (istrstr (new, cpp[j]) == NULL) + if (strstr (new, cpp[j]) == NULL) ++j; else {