From: Rob Landley Date: Sun, 2 Dec 2012 00:30:20 +0000 (-0600) Subject: First guess at what internationalization support for expand would look like. X-Git-Tag: 0.4.2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ddd4685b3482dfe4bea9d72fee2b47bddde42697;p=platform%2Fupstream%2Ftoybox.git First guess at what internationalization support for expand would look like. --- diff --git a/toys/posix/expand.c b/toys/posix/expand.c index d1b82a7..789364b 100644 --- a/toys/posix/expand.c +++ b/toys/posix/expand.c @@ -45,7 +45,22 @@ static void expand_file(int fd, char *name) if (!len) break; for (i=0; i 1) { + if (width != fwrite(toybuf+i, width, 1, stdout)) + perror_exit("stdout"); + i += width-1; + x++; + continue; + } else if (width == -2) break; + else if (width == -1) continue; + } + c = toybuf[i]; if (c != '\t') { if (EOF == putc(c, stdout)) perror_exit(0);