shithub: neatroff

Download patch

ref: e4cf02eeb714391259ef92b9660b37634440e13d
parent: 19964e45f77c190d9c46228825d5974db995b653
author: Ali Gholami Rudi <ali@rudi.ir>
date: Mon May 23 17:31:48 EDT 2016

char: read invalid characters byte by byte

--- a/char.c
+++ b/char.c
@@ -9,6 +9,8 @@
 {
 	if (~c & 0x80)
 		return c > 0;
+	if (~c & 0x40)
+		return 1;
 	if (~c & 0x20)
 		return 2;
 	if (~c & 0x10)
@@ -15,10 +17,6 @@
 		return 3;
 	if (~c & 0x08)
 		return 4;
-	if (~c & 0x04)
-		return 5;
-	if (~c & 0x02)
-		return 6;
 	return 1;
 }