summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2014-07-15 14:16:59 -0400
committerQuentin Carbonneaux2014-07-15 14:16:59 -0400
commit8f06b439e731093572b4dd1eca657b65553ea007 (patch)
tree09f1747bc3af81d78d3347ed9660ce7ae75834bd
parent94578f2aaa8be12714239ac5f6f17f2975852d75 (diff)
abort empty searches
-rw-r--r--exec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index 70728be..7d32c2e 100644
--- a/exec.c
+++ b/exec.c
@@ -62,6 +62,9 @@ ex_look(W *w, Rune *s, unsigned n)
eb_yank(w->eb, s0, s1, &lb);
}
+ if (lb.nr == 0)
+ return 1;
+
p = eb_look(w->eb, w->cu+1, lb.r, lb.nr);
if (p == -1u)
p = eb_look(w->eb, 0, lb.r, lb.nr);