ia64/xen-unstable
changeset 17507:4f9284a5d3ab
figlet: Fix handling of full final line of octal output.
It should not be terminated with a backslash.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
It should not be terminated with a backslash.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Wed Apr 23 09:02:15 2008 +0100 (2008-04-23) |
parents | 2ebb7f79e3bb |
children | a5319f23db7c |
files | xen/tools/figlet/figlet.c |
line diff
1.1 --- a/xen/tools/figlet/figlet.c Tue Apr 22 19:07:48 2008 +0100 1.2 +++ b/xen/tools/figlet/figlet.c Wed Apr 23 09:02:15 2008 +0100 1.3 @@ -1488,7 +1488,16 @@ static void myputchar(unsigned char c) 1.4 1.5 putc(c, stderr); 1.6 1.7 - if ( nr_chars == 0 ) 1.8 + if ( nr_chars == 18 ) 1.9 + { 1.10 + nr_chars = 0; 1.11 + putchar('"'); 1.12 + putchar(' '); 1.13 + putchar('\\'); 1.14 + putchar('\n'); 1.15 + } 1.16 + 1.17 + if ( nr_chars++ == 0 ) 1.18 putchar('"'); 1.19 1.20 putchar('\\'); 1.21 @@ -1498,15 +1507,6 @@ static void myputchar(unsigned char c) 1.22 1.23 if ( c == '\n' ) 1.24 startline = 1; 1.25 - 1.26 - if ( ++nr_chars == 18 ) 1.27 - { 1.28 - nr_chars = 0; 1.29 - putchar('"'); 1.30 - putchar(' '); 1.31 - putchar('\\'); 1.32 - putchar('\n'); 1.33 - } 1.34 } 1.35 1.36 void putstring(string)