shithub: mc

Download patch

ref: 6c956603963fa9dce41cf9dc38a1ecbbff60bc94
parent: 04533d17c0b822121016ad48954aa05ca3b719d3
author: Ori Bernstein <[email protected]>
date: Fri Nov 24 18:37:37 EST 2017

Don't loop infinitely computing cellwidth of bad chars.

--- a/lib/std/utf.myr
+++ b/lib/std/utf.myr
@@ -143,7 +143,7 @@
 
 	while s.len > 0
 		(c, s) = charstep(s)
-		if c == Badchar
+		if s.len != 0 && c == Badchar
 			/* Something will probably be printed as U+FFFD */
 			n++
 		elif c < 0x20