svn commit: trunk/busybox/libbb

vda at busybox.net vda at busybox.net
Wed Jun 18 20:01:13 UTC 2008


Author: vda
Date: 2008-06-18 13:01:12 -0700 (Wed, 18 Jun 2008)
New Revision: 22443

Log:
strrchr: actually, last one was finding "" in "any" at pos 0,
should find at pos LAST...



Modified:
   trunk/busybox/libbb/strrstr.c


Changeset:
Modified: trunk/busybox/libbb/strrstr.c
===================================================================
--- trunk/busybox/libbb/strrstr.c	2008-06-18 19:49:46 UTC (rev 22442)
+++ trunk/busybox/libbb/strrstr.c	2008-06-18 20:01:12 UTC (rev 22443)
@@ -24,7 +24,7 @@
 	char *r = NULL;
 
 	if (!needle[0])
-		return (char*)haystack;
+		return (char*)haystack + strlen(haystack);
 	while (1) {
 		char *p = strstr(haystack, needle);
 		if (!p)




More information about the busybox-cvs mailing list