diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-18 20:01:12 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-18 20:01:12 +0000 |
commit | 1363f0df150e26c9457a8ccbe35580843bae3319 (patch) | |
tree | f851a241bc9fd2500844f73be27ae77de59fc281 | |
parent | d5736c560703725d13c88234f03e82693212c265 (diff) | |
download | busybox-w32-1363f0df150e26c9457a8ccbe35580843bae3319.tar.gz busybox-w32-1363f0df150e26c9457a8ccbe35580843bae3319.tar.bz2 busybox-w32-1363f0df150e26c9457a8ccbe35580843bae3319.zip |
strrchr: actually, last one was finding "" in "any" at pos 0,
should find at pos LAST...
-rw-r--r-- | libbb/strrstr.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
24 | char *r = NULL; | 24 | char *r = NULL; |
25 | 25 | ||
26 | if (!needle[0]) | 26 | if (!needle[0]) |
27 | return (char*)haystack; | 27 | return (char*)haystack + strlen(haystack); |
28 | while (1) { | 28 | while (1) { |
29 | char *p = strstr(haystack, needle); | 29 | char *p = strstr(haystack, needle); |
30 | if (!p) | 30 | if (!p) |