summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2014-07-20 22:21:42 -0400
committerQuentin Carbonneaux2014-07-20 22:21:42 -0400
commit6d1da4517ff54c09de38516b4f274fa9316bbf10 (patch)
tree9d5e70c8bbb0d31e9ced980e626ed63caa9fcd29
parent659d227cd1ec5c722ba405e203295ae88e32b402 (diff)
handle empty strings in ex_look
-rw-r--r--exec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index 72c37fc..3196c44 100644
--- a/exec.c
+++ b/exec.c
@@ -61,6 +61,8 @@ ex_look(W *w, Rune *s, unsigned n)
{
unsigned p;
+ if (n == 0)
+ return 1;
p = eb_look(w->eb, w->cu+1, s, n);
if (p == -1u)
p = eb_look(w->eb, 0, s, n);