bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Avoid printing LF in progs/tabs.c


From: James Clarke
Subject: [PATCH] Avoid printing LF in progs/tabs.c
Date: Fri, 17 Apr 2015 12:18:39 +0100

Rather than terminating the string printed to the terminal with LF, we
can terminate it with CR. This avoids having a blank line appear in the
terminal after calling tabs.
---
Version: 5:0:9   5.9     20150404

I don't know why this was using LF, but the FreeBSD equivalent uses CR (e.g.
https://github.com/freebsd/freebsd/blob/330cbf8/usr.bin/tabs/tabs.c#L181).
Tested on the Linux console and GNOME Terminal.
---
 progs/tabs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --unified a/progs/tabs.c b/progs/tabs.c
--- a/progs/tabs.c
+++ b/progs/tabs.c
@@ -79,7 +79,7 @@ do_tabs(int *tab_list)
            break;
        }
     }
-    putchar('\n');
+    putchar('\r');
 }
 
 static int *
--



reply via email to

[Prev in Thread] Current Thread [Next in Thread]