eat crs in console output Reference: /n/sources/patch/maybe/clognocr Date: Fri Oct 24 04:02:26 CES 2008 Signed-off-by: quanstro@quanstro.net --- /sys/src/cmd/aux/clog.c Fri Oct 24 04:02:22 2008 +++ /sys/src/cmd/aux/clog.c Fri Oct 24 04:02:21 2008 @@ -24,7 +24,7 @@ main(int argc, char **argv) { Biobuf in; - int fd; + int fd, l; char *p, *t; char buf[8192]; @@ -45,7 +45,9 @@ for(;;){ if(p = Brdline(&in, '\n')){ - p[Blinelen(&in)-1] = 0; + p[l =Blinelen(&in)-1] = 0; + if(l && p[l-1] == '\r') + p[l-1] = 0; t = ctime(time(0)); t[19] = 0; if(fprint(fd, "%s: %s\n", t, p) < 0){