summaryrefslogtreecommitdiffstats
path: root/groff-grotty-wc-no-sgr.patch
blob: 920979c166d156313246cfb47ccca7a62914b38f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Fix handling of wide characters in no-SGR mode.

Fixes: #712904 Japanese bold/underlined text not displayed correctly

Patch from upstream CVS:

2011-01-20  Colin Watson  <cjwatson@debian.org>

	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.

Index: src/devices/grotty/tty.cpp
===================================================================
RCS file: /sources/groff/groff/src/devices/grotty/tty.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- a/src/devices/grotty/tty.cpp	13 Dec 2010 17:42:28 -0000	1.23
+++ b/src/devices/grotty/tty.cpp	20 Jan 2011 07:13:57 -0000	1.24
@@ -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 @@
     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 @@
     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 {