generate CRLF instead of LF
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Fri, 14 Jul 2006 20:26:42 +0000 (20:26 +0000)
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Fri, 14 Jul 2006 20:26:42 +0000 (20:26 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2055 c046a42c-6fe2-441c-8c8c-71466251a162

monitor.c
vl.c

index 9a18639c4b2fa0f2574bf9e1241a6fb9b3e7c90f..5edd39e9225e9d4763f4b75055ed7c7c49e780fb 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -82,8 +82,10 @@ void term_puts(const char *str)
         c = *str++;
         if (c == '\0')
             break;
+        if (c == '\n')
+            term_outbuf[term_outbuf_index++] = '\r';
         term_outbuf[term_outbuf_index++] = c;
-        if (term_outbuf_index >= sizeof(term_outbuf) ||
+        if (term_outbuf_index >= (sizeof(term_outbuf) - 1) ||
             c == '\n')
             term_flush();
     }
diff --git a/vl.c b/vl.c
index 77ebd3557f0ea8008a44f83fe18086098435c9bc..6787332ba7223bee3694b4cd3e45a5a7a79e2004 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -6159,7 +6159,7 @@ int main(int argc, char **argv)
                 exit(1);
             }
             if (!strcmp(serial_devices[i], "vc"))
-                qemu_chr_printf(serial_hds[i], "serial%d console\n", i);
+                qemu_chr_printf(serial_hds[i], "serial%d console\r\n", i);
         }
     }
 
@@ -6172,7 +6172,7 @@ int main(int argc, char **argv)
                 exit(1);
             }
             if (!strcmp(parallel_devices[i], "vc"))
-                qemu_chr_printf(parallel_hds[i], "parallel%d console\n", i);
+                qemu_chr_printf(parallel_hds[i], "parallel%d console\r\n", i);
         }
     }