comparison 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
comparison
equal deleted inserted replaced
45:6466e8720e04 46:5b7d21698a80
113 113
114 int 114 int
115 _write(int file, char *ptr, int len) { 115 _write(int file, char *ptr, int len) {
116 int todo; 116 int todo;
117 117
118 file = file; /* avoid warning */
119 for (todo = 0; todo < len; todo++) { 118 for (todo = 0; todo < len; todo++) {
120 comm_put(*ptr++); 119 if (file == 1 || file == 2)
120 if (*ptr == '\n')
121 comm_put('\r');
122 comm_put(*ptr);
123 ptr++;
121 } 124 }
122 return len; 125 return len;
123 } 126 }
124 127
125 int 128 int