libarchive: open_zipped() does not need to check extensions for e.g. gzip
[oweals/busybox.git] / libbb / strrstr.c
index 088d9f45733934d1aa863fde08d3ecee865a94c2..d8823fc5117631b5cda95690158d32f4f272b4c9 100644 (file)
@@ -2,9 +2,9 @@
 /*
  * Utility routines.
  *
- * Copyright (C) 2008 Bernhard Fischer
+ * Copyright (C) 2008 Bernhard Reutner-Fischer
  *
- * Licensed under GPLv2 or later, see file License in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
 #ifdef __DO_STRRSTR_TEST
  * The strrstr() function finds the last occurrence of the substring needle
  * in the string haystack. The terminating nul characters are not compared.
  */
-char* strrstr(const char *haystack, const char *needle)
+char* FAST_FUNC 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)