git: 9front

Download patch

ref: 188294c2cadec780e0828645c273f6f9c74a8c01
parent: e2a98338c845b46921a9a9a824ea2fb98b5c96f9
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Jan 11 05:46:07 EST 2014

rio: properly handle initial wrap arround in wlook()

--- a/sys/src/cmd/rio/wind.c
+++ b/sys/src/cmd/rio/wind.c
@@ -900,6 +900,9 @@
 	if(n <= 0 || e < n)
 		return;
 
+	if(i > e)
+		i = 0;
+
 	while(runestrncmp(w->r+w->q0, w->r+i, n) != 0){
 		if(i < e)
 			i++;
--