From 1363f0df150e26c9457a8ccbe35580843bae3319 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Wed, 18 Jun 2008 20:01:12 +0000 Subject: strrchr: actually, last one was finding "" in "any" at pos 0, should find at pos LAST... --- libbb/strrstr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libbb/strrstr.c b/libbb/strrstr.c index 088d9f4..f61dd51 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) -- cgit v1.1