From b8e0920c180f81f86f0888804445f67a2a76fe2b Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 27 Jun 2017 14:57:28 -0500 Subject: whitespace/comment tweaks. --- toys/posix/head.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'toys/posix/head.c') diff --git a/toys/posix/head.c b/toys/posix/head.c index 6153b42f..ea4bbbc6 100644 --- a/toys/posix/head.c +++ b/toys/posix/head.c @@ -3,7 +3,8 @@ * Copyright 2006 Timothy Elliott * * See http://opengroup.org/onlinepubs/9699919799/utilities/head.html - * See http://man7.org/linux/man-pages/man1/head.1.html + * + * Deviations from posix: -c USE_HEAD(NEWTOY(head, "?n#<0=10c#<0qv[-nc]", TOYFLAG_USR|TOYFLAG_BIN)) @@ -42,7 +43,7 @@ static void do_head(int fd, char *name) xflush(); } - while (toys.optflags & FLAG_c ? bytes : lines) { + while ((toys.optflags&FLAG_c) ? bytes : lines) { len = read(fd, toybuf, sizeof(toybuf)); if (len<0) perror_msg_raw(name); if (len<1) break; @@ -50,8 +51,7 @@ static void do_head(int fd, char *name) if (bytes) { i = bytes >= len ? len : bytes; bytes -= i; - } else - for(i=0; i