shithub: neatroff

Download patch

ref: 43cd1d55e135a83bf803145c5bc2f7a9feb9d62e
parent: 7e8f405b356b42f085d72975cd9c423d034afcf8
author: Ali Gholami Rudi <ali@rudi.ir>
date: Thu Aug 7 08:43:19 EDT 2014

wb: call wb_putbuf() to mark hyphenation points

--- a/wb.c
+++ b/wb.c
@@ -211,7 +211,6 @@
 	int x[WORDLEN], y[WORDLEN], xadv[WORDLEN], yadv[WORDLEN];
 	int dmap[WORDLEN];
 	char src_hyph[WORDLEN];
-	char hc[GNLEN];
 	int dst_n, i;
 	if (!wb->sub_n || !wb->sub_collect)
 		return;
@@ -223,7 +222,6 @@
 		gsrc[i] = font_find(fn, wb->sub_c[i]);
 	dst_n = font_layout(fn, gsrc, wb->sub_n, wb->s,
 			gdst, dmap, x, y, xadv, yadv, n_lg, n_kn);
-	charnext_str(hc, c_hc);
 	for (i = 0; i < dst_n; i++) {
 		if (x[i])
 			wb_hmov(wb, DEVWID(wb->s, x[i]));
@@ -230,7 +228,7 @@
 		if (y[i])
 			wb_vmov(wb, DEVWID(wb->s, y[i]));
 		if (src_hyph[dmap[i]])
-			sbuf_printf(&wb->sbuf, "%s", hc);
+			wb_putbuf(wb, c_hc);
 		if (gdst[i] == gsrc[dmap[i]])
 			wb_putbuf(wb, wb->sub_c[dmap[i]]);
 		else