]> git.mdlowis.com Git - projs/tide.git/commitdiff
Fixed a bug where the non-existence of a search term in the document resulted in...
authorMichael D. Lowis <mike.lowis@gentex.com>
Fri, 16 Dec 2016 15:01:10 +0000 (10:01 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Fri, 16 Dec 2016 15:01:10 +0000 (10:01 -0500)
libedit/buf.c

index 2013867ecae1354d27ce587159ca7a68102d9d8f..268d20dced307fb4c26f6cbdba8e31ca3ba9e77f 100644 (file)
@@ -387,7 +387,7 @@ void buf_findstr(Buf* buf, char* str, size_t* beg, size_t* end) {
     Rune* runes = charstorunes(str);
     size_t rlen = runelen(runes);
     unsigned start = *beg, mbeg = start+1, mend = mbeg + rlen;
-    while (true) {
+    while (mbeg != start) {
         if ((buf_get(buf, mbeg) == runes[0]) &&
             (buf_get(buf, mend-1) == runes[rlen-1]) &&
             (0 == rune_match(buf, mbeg, mend, runes)))