shithub: mc

Download patch

ref: 5bd13051227a06d06f323e90c18ecd29af921aa2
parent: 815fc3522ecffb70ccfec63115e693a4df3a0296
author: Ori Bernstein <[email protected]>
date: Sun Aug 5 22:04:48 EDT 2012

Dont' clobber the top bits for a length 1 encoding.

    We don't mask out the zero bit in the case where we have a multibyte
    sequence, but that's ok because we already tested that it's zero.

--- a/str.myr
+++ b/str.myr
@@ -96,7 +96,7 @@
 		-> (Badchar, str[1,str.len])
 	;;
 
-	mask = (1 << (7 - len)) - 1
+	mask = (1 << (8 - len)) - 1
 	chr = (c castto(uint32)) & mask
 	for i = 1; i < len; i++
 		tmp = str[i] castto(uint32)