shithub: neatroff

Download patch

ref: 19cf35dbea4392f893b256c107ea23668d716774
parent: 6bb9b6baf0df4ecb6c36894dc577b05f308084a2
author: Ali Gholami Rudi <ali@rudi.ir>
date: Tue Jul 8 13:39:53 EDT 2014

hyph: ignore multi-character hcode mappings

This patch ignores lines of the file specified as the third
argument of .hpf that contain more than two characters.  Reported
by Dirk-Wilhelm Peters <peters@schwertfische.de>.

--- a/hyph.c
+++ b/hyph.c
@@ -264,7 +264,7 @@
 	if (args[3] && (filp = fopen(args[3], "r"))) {
 		while (fscanf(filp, "%s", tok) == 1) {
 			char *s = tok;
-			if (utf8read(&s, c1) && utf8read(&s, c2))
+			if (utf8read(&s, c1) && utf8read(&s, c2) && !*s)
 				hcode_add(c2, c1);	/* inverting */
 		}
 		fclose(filp);