]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Francesco Chemolli <kinkie@squid-cache.org> SQUID_3_1_0_6
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Mar 2009 10:10:46 +0000 (23:10 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Mar 2009 10:10:46 +0000 (23:10 +1300)
Fixed String search

src/HttpHeaderTools.cc
src/String.cc

index 33ac3d5712667cb5f4ceb503d1e75ba5dc786567..85c827ddee6a85e8d8045488fb2d862dccea5a92 100644 (file)
@@ -189,7 +189,7 @@ int
 strListIsSubstr(const String * list, const char *s, char del)
 {
     assert(list && del);
-    return list->pos(s) != 0;
+    return (list->find(s) != String::npos);
 
     /** \note
      * Note: the original code with a loop is broken because it uses strstr()
@@ -359,7 +359,7 @@ httpHeaderParseQuotedString (const char *start, String *val)
 
 /**
  * Checks the anonymizer (header_access) configuration.
- * 
+ *
  * \retval 0    Header is explicitly blocked for removal
  * \retval 1    Header is explicitly allowed
  * \retval 1    Header has been replaced, the current version can be used.
index 90758326fed739a29090b9a2494333625da36493..a68af96883678c127e4e1f1c6ec002c5c932b6ec 100644 (file)
@@ -437,18 +437,24 @@ checkNullString(const char *p)
 const char *
 String::pos(char const *aString) const
 {
+    if (undefined())
+        return NULL;
     return strstr(termedBuf(), aString);
 }
 
 const char *
 String::pos(char const ch) const
 {
+    if (undefined())
+        return NULL;
     return strchr(termedBuf(), ch);
 }
 
 const char *
 String::rpos(char const ch) const
 {
+    if (undefined())
+        return NULL;
     return strrchr(termedBuf(), (ch));
 }