From: Michael D. Lowis Date: Fri, 16 Dec 2016 15:01:10 +0000 (-0500) Subject: Fixed a bug where the non-existence of a search term in the document resulted in... X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=ba7671604c5c7f1410a389c0c2d51e6d52ced23e;p=projs%2Ftide.git Fixed a bug where the non-existence of a search term in the document resulted in an infinite loop --- diff --git a/libedit/buf.c b/libedit/buf.c index 2013867..268d20d 100644 --- a/libedit/buf.c +++ b/libedit/buf.c @@ -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)))