WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-3.4-testing] minios: fix console end of line: \n\r

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.4-testing] minios: fix console end of line: \n\r -> \r\n
From: "Xen patchbot-3.4-testing" <patchbot-3.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 23 Oct 2009 02:40:36 -0700
Delivery-date: Fri, 23 Oct 2009 02:41:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1256289598 -3600
# Node ID 9c2328a6f768265646da64094fe9a58134e2e0e6
# Parent  774e2cf9d238e664ab61281671b1dcb0ab7da221
minios: fix console end of line: \n\r -> \r\n

Change the end of line produced by minios' console from \n\r to \r\n.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
xen-unstable changeset:   20311:71c859535c6b
xen-unstable date:        Wed Oct 14 08:58:47 2009 +0100
---
 extras/mini-os/console/console.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff -r 774e2cf9d238 -r 9c2328a6f768 extras/mini-os/console/console.c
--- a/extras/mini-os/console/console.c  Fri Oct 23 10:19:36 2009 +0100
+++ b/extras/mini-os/console/console.c  Fri Oct 23 10:19:58 2009 +0100
@@ -79,7 +79,7 @@ void console_print(char *data, int lengt
 void console_print(char *data, int length)
 {
     char *curr_char, saved_char;
-    char copied_str[length];
+    char copied_str[length+1];
     char *copied_ptr;
     int part_len;
     int (*ring_send_fn)(const char *data, unsigned length);
@@ -95,8 +95,9 @@ void console_print(char *data, int lengt
     {
         if(*curr_char == '\n')
         {
+            *curr_char = '\r';
             saved_char = *(curr_char+1);
-            *(curr_char+1) = '\r';
+            *(curr_char+1) = '\n';
             part_len = curr_char - copied_ptr + 2;
             ring_send_fn(dev, copied_ptr, part_len);
             *(curr_char+1) = saved_char;
@@ -104,11 +105,14 @@ void console_print(char *data, int lengt
             length -= part_len - 1;
         }
     }
+
+    if (copied_ptr[length-1] == '\n') {
+        copied_ptr[length-1] = '\r';
+        copied_ptr[length] = '\n';
+        length++;
+    }
     
     ring_send_fn(dev, copied_ptr, length);
-    
-    if(copied_ptr[length-1] == '\n')
-        ring_send_fn("\r", 1);
 }
 
 void print(int direct, const char *fmt, va_list args)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.4-testing] minios: fix console end of line: \n\r -> \r\n, Xen patchbot-3.4-testing <=