summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/search.c b/src/search.c
index a063a26be..addb9cdb0 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1930,7 +1930,7 @@ findmatchlimit(oap, initc, flags, maxtravel)
break;
--pos.lnum;
- if (maxtravel && traveled++ > maxtravel)
+ if (maxtravel > 0 && ++traveled > maxtravel)
break;
linep = ml_get(pos.lnum);