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

[Xen-changelog] [xen-unstable] figlet: Fix handling of full final line of octal output.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1208937735 -3600
# Node ID 4f9284a5d3ab4fb402e6838f39fb2e43ee833779
# Parent  2ebb7f79e3bb44a3736144d5eb6e590423aa0338
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@xxxxxxxxxx>
---
 xen/tools/figlet/figlet.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff -r 2ebb7f79e3bb -r 4f9284a5d3ab xen/tools/figlet/figlet.c
--- a/xen/tools/figlet/figlet.c Tue Apr 22 19:07:48 2008 +0100
+++ b/xen/tools/figlet/figlet.c Wed Apr 23 09:02:15 2008 +0100
@@ -1488,18 +1488,7 @@ static void myputchar(unsigned char c)
 
     putc(c, stderr);
 
-    if ( nr_chars == 0 )
-        putchar('"');
-
-    putchar('\\');
-    putchar('0' + ((c>>6)&7));
-    putchar('0' + ((c>>3)&7));
-    putchar('0' + ((c>>0)&7));
-
-    if ( c == '\n' )
-        startline = 1;
-
-    if ( ++nr_chars == 18 ) 
+    if ( nr_chars == 18 ) 
     {
         nr_chars = 0;
         putchar('"');
@@ -1507,6 +1496,17 @@ static void myputchar(unsigned char c)
         putchar('\\');
         putchar('\n');
     }
+
+    if ( nr_chars++ == 0 )
+        putchar('"');
+
+    putchar('\\');
+    putchar('0' + ((c>>6)&7));
+    putchar('0' + ((c>>3)&7));
+    putchar('0' + ((c>>0)&7));
+
+    if ( c == '\n' )
+        startline = 1;
 }
 
 void putstring(string)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.