diff syscalls.c @ 46:5b7d21698a80

When writing to stdout/stderr translate \n to \r\n.
author Daniel O'Connor <darius@dons.net.au>
date Wed, 03 Apr 2013 23:29:16 +1030
parents 2ecde7a4bc55
children 0e7d687a2322
line wrap: on
line diff
--- a/syscalls.c	Tue Apr 02 14:49:50 2013 +1030
+++ b/syscalls.c	Wed Apr 03 23:29:16 2013 +1030
@@ -115,9 +115,12 @@
 _write(int file, char *ptr, int len) {
     int todo;
     
-    file = file; /* avoid warning */
     for (todo = 0; todo < len; todo++) {
-	comm_put(*ptr++);
+	if (file == 1 || file == 2)
+	    if (*ptr == '\n')
+		comm_put('\r');
+	comm_put(*ptr);
+	ptr++;
     }
     return len;
 }