shithub: neatroff

Download patch

ref: 72b10b4403a811e2e95c9b7dbbc5098af022f669
parent: 156edb7214f62f225bc009bcbd2953f0e99b7d42
author: Ali Gholami Rudi <ali@rudi.ir>
date: Wed Apr 24 14:47:34 EDT 2013

tr: reading empty macros

--- a/tr.c
+++ b/tr.c
@@ -103,10 +103,13 @@
 {
 	char buf[4];
 	int i, c;
+	int first = 1;
+	cp_back('\n');
 	cp_wid(0);		/* copy-mode; disable \w handling */
 	while ((c = cp_next()) >= 0) {
-		if (sbuf)
+		if (sbuf && !first)
 			sbuf_add(sbuf, c);
+		first = 0;
 		if (c == '\n') {
 			c = cp_next();
 			if (c == '.') {