replicate by: open acme on a file of length 8215 bytes, position the cursor at the end, and right-click-search for a string that isn't in the file... and it'll go into an infinite loop. it happens whenever the buffer read is exactly one short of the end of the file. i think this bug has probably been around from day 1, which is interesting, because it's not *that* improbable an event... Reference: /n/sources/patch/applied/acme-search-hangup Date: Wed Nov 21 17:15:59 CET 2007 Signed-off-by: rogpeppe@gmail.com --- /sys/src/cmd/acme/look.c Wed Nov 21 11:58:51 2007 +++ /sys/src/cmd/acme/look.c Wed Nov 21 11:58:48 2007 @@ -299,11 +299,11 @@ fbuffree(s); return TRUE; } - if(around && q>=ct->q1) - break; --nb; b++; q++; + if(around && q>=ct->q1) + break; } fbuffree(s); return FALSE;