shithub: mc

Download patch

ref: 10fcb3eade99dfc59043d3488375e863edb068ee
parent: 05556216828b0cddaa1be740c5231ecc9ab2e6af
author: Ori Bernstein <[email protected]>
date: Thu Jan 2 14:31:07 EST 2014

Fix bug in strstrip if we don't enter strip loop.

    We would return a zero lenth string.

--- a/libstd/strstrip.myr
+++ b/libstd/strstrip.myr
@@ -30,7 +30,7 @@
 	var end
 
 	/* scan backwards for start of utf8 char */
-	end = 0
+	end = str.len
 	for i = str.len; i != 0; i--
 		if str[i] & 0x80 == 0
 			if !isspace(decode(str[i-1:]))