>From 1c43ce41cae8277b70aea15f1178d0c499646e96 Mon Sep 17 00:00:00 2001
From: Ilya Kuzmich <ilya.kuzmich@gmail.com>
Date: Tue, 30 May 2017 23:32:24 +0300
Subject: [PATCH] head: shorten loop

Signed-off-by: Ilya Kuzmich <ilya.kuzmich@gmail.com>
---
 toys/posix/head.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/toys/posix/head.c b/toys/posix/head.c
index 63eb85b..f5fd281 100644
--- a/toys/posix/head.c
+++ b/toys/posix/head.c
@@ -34,7 +34,7 @@ static void do_head(int fd, char *name)
 
   if ((toys.optc > 1 && !(toys.optflags & FLAG_q)) || toys.optflags & FLAG_v) {
     // Print an extra newline for all but the first file
-    if (TT.file_no) xprintf("\n");
+    if (TT.file_no++) xprintf("\n");
     xprintf("==> %s <==\n", name);
     xflush();
   }
@@ -48,8 +48,6 @@ static void do_head(int fd, char *name)
 
     xwrite(1, toybuf, i);
   }
-
-  TT.file_no++;
 }
 
 void head_main(void)
-- 
2.7.4

