From: Denis Vlasenko Date: Wed, 18 Jun 2008 20:01:12 +0000 (-0000) Subject: strrchr: actually, last one was finding "" in "any" at pos 0, X-Git-Tag: 1_11_0~28 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1363f0df150e26c9457a8ccbe35580843bae3319;p=oweals%2Fbusybox.git strrchr: actually, last one was finding "" in "any" at pos 0, should find at pos LAST... --- diff --git a/libbb/strrstr.c b/libbb/strrstr.c index 088d9f457..f61dd517f 100644 --- a/libbb/strrstr.c +++ b/libbb/strrstr.c @@ -24,7 +24,7 @@ char* strrstr(const char *haystack, const char *needle) char *r = NULL; if (!needle[0]) - return (char*)haystack; + return (char*)haystack + strlen(haystack); while (1) { char *p = strstr(haystack, needle); if (!p)