diff options
Diffstat (limited to 'sys/cmd/rc/io.c')
-rw-r--r-- | sys/cmd/rc/io.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/cmd/rc/io.c b/sys/cmd/rc/io.c index 2fbe57f..e06bfcc 100644 --- a/sys/cmd/rc/io.c +++ b/sys/cmd/rc/io.c @@ -94,8 +94,8 @@ flush(Io **fp) n = f->b - f->buf; if (n && write(f->fd, f->buf, n) < 0) { write(3, "write error\n", 12); - if (ntrap) - dotrap(); + // if (ntrap) + // dotrap(); } f->b = f->buf; f->e = f->buf + bufsize; @@ -153,10 +153,10 @@ void pwrd(Io *f, char *s) { char *t; - for (t = s; *t; t++) - if (!wordchr(*t)) + for(t = s; *t; t++) + if(!wordchr(*t)) break; - if (t == s || *t) + if(t == s || *t) pquo(f, s); else pstr(f, s); @@ -186,10 +186,10 @@ pptr(Io *f, void *v) void pstr(Io *f, char *s) { - if (!s) + if(!s || !s[0]) s = "<null>"; - while (*s) + while(*s) pchr(f, *s++); } @@ -228,8 +228,8 @@ poct(Io *f, uint n) void pval(Io *f, Word *a) { - if (a) { - while (a->link && a->link->word) { + if(a) { + while(a->link && a->link->word) { pwrd(f, a->word); pchr(f, ' '); a = a->link; @@ -416,6 +416,9 @@ vpfmt(Io *f, char *fmt, va_list args) case 'q': pwrd(f, va_arg(args, char*)); break; + case 'r': + pstr(f, strerror(errno)); + break; case 's': pstr(f, va_arg(args, char*)); break; |