From ddd4685b3482dfe4bea9d72fee2b47bddde42697 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 1 Dec 2012 18:30:20 -0600 Subject: First guess at what internationalization support for expand would look like. --- toys/posix/expand.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'toys') diff --git a/toys/posix/expand.c b/toys/posix/expand.c index d1b82a7c..789364bb 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); -- cgit v1.2.3