eat carrage returns to prevent them from getting into console log files. Notes: Fri Feb 5 12:13:31 EST 2010 geoff duplicate of undecided/clognocr, still to be processed. Reference: /n/sources/patch/sorry/clogcr Date: Thu Feb 4 20:08:36 CET 2010 Signed-off-by: quanstro@quanstro.net Reviewed-by: geoff --- /sys/src/cmd/aux/clog.c Thu Feb 4 20:07:48 2010 +++ /sys/src/cmd/aux/clog.c Thu Feb 4 20:07:47 2010 @@ -25,7 +25,7 @@ main(int argc, char **argv) { Biobuf in; - int fd; + int fd, l; char *p, *t; char buf[Bsize]; @@ -46,7 +46,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; while(fprint(fd, "%s: %s\n", t, p) < 0) {