summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-07-27 07:25:54 +0000
committerRichard M. Stallman <rms@gnu.org>1993-07-27 07:25:54 +0000
commit3f57a49957134c4601103d12930583cd8f65ada5 (patch)
tree5ea9b2e6613092397477845921478be7b3ca5ec7 /src/search.c
parent9d021db37bedefd95a42e324299e99e525d73a2a (diff)
downloademacs-3f57a49957134c4601103d12930583cd8f65ada5.tar.gz
(search_buffer): If n is 0, just return POS.
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/search.c b/src/search.c
index b43756f0a5c..e0ca9a5bf6d 100644
--- a/src/search.c
+++ b/src/search.c
@@ -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)