From 88cb540f524f0df1dea0c34c7740c11eab29856c Mon Sep 17 00:00:00 2001 From: wl Date: Thu, 20 Jan 2011 07:13:57 +0000 Subject: Fix handling of wide characters in no-SGR mode. * src/devices/grotty/tty.cpp (tty_printer::make_underline): Only emit a single backspace in no-SGR mode. less (at least) backspaces over a character at a time. (tty_printer::make_bold): Likewise. --- src/devices/grotty/tty.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp index 87654107..e25f934d 100644 --- a/src/devices/grotty/tty.cpp +++ b/src/devices/grotty/tty.cpp @@ -1,6 +1,6 @@ // -*- C++ -*- -/* Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, - 2010 +/* Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2009-2011 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -311,11 +311,8 @@ void tty_printer::make_underline(int w) if (!w) warning("can't underline zero-width character"); else { - int n = w / font::hor; - for (int i = 0; i < n; i++) - putchar('_'); - for (int j = 0; j < n; j++) - putchar('\b'); + putchar('_'); + putchar('\b'); } } else { @@ -337,10 +334,8 @@ void tty_printer::make_bold(output_character c, int w) if (!w) warning("can't print zero-width character in bold"); else { - int n = w / font::hor; put_char(c); - for (int i = 0; i < n; i++) - putchar('\b'); + putchar('\b'); } } else { -- cgit v1.2.1