(search_buffer): If n is 0, just return POS.
authorRichard M. Stallman <rms@gnu.org>
Tue, 27 Jul 1993 07:25:54 +0000 (07:25 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 27 Jul 1993 07:25:54 +0000 (07:25 +0000)
src/search.c

index b43756f..e0ca9a5 100644 (file)
@@ -610,7 +610,11 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt)
   int s1, s2;
 
   /* Null string is found at starting position.  */
-  if (!len)
+  if (len == 0)
+    return pos;
+
+  /* Searching 0 times means don't move.  */
+  if (n == 0)
     return pos;
 
   if (RE)