Hi,

Here's a patch that allows octstr_search_chars to not ignore its
`pos' parameter.

Additionally, it performs octstr_search-similar checks and now
fits more along the lines of doc/CodingStyle.

Index: gwlib/octstr.c
===================================================================
RCS file: /home/cvs/gateway/gwlib/octstr.c,v
retrieving revision 1.159
diff -u -r1.159 octstr.c
--- gwlib/octstr.c	8 Mar 2004 23:09:42 -0000	1.159
+++ gwlib/octstr.c	19 Apr 2004 11:28:11 -0000
@@ -958,11 +958,17 @@
 int octstr_search_chars(const Octstr *ostr, const Octstr *chars, long pos)
 {
     long i, j;
-    for(i=0; i < octstr_len(chars); i++) {
-	j = octstr_search_char(ostr, octstr_get_char(chars, i), 0);
-	if(j != -1)
+
+    seems_valid(ostr);
+    seems_valid(chars);
+    gw_assert(pos >= 0);
+
+    for (i = 0; i < octstr_len(chars); i++) {
+	j = octstr_search_char(ostr, octstr_get_char(chars, i), pos);
+	if (j != -1)
 	    return j;
     }
+
     return -1;
 }
 
-- 
Guillaume Cottenceau

Reply via email to