From 009b55edc4bad5b46ace88f3c255bbff8671d137 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 26 Aug 2018 14:16:49 -0500 Subject: Convert more commands to the new option/GLOBALS code style. --- 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 ea4bbbc6..0cec4033 100644 --- a/toys/posix/head.c +++ b/toys/posix/head.c @@ -27,14 +27,14 @@ config HEAD #include "toys.h" GLOBALS( - long bytes; - long lines; + long c, n; + int file_no; ) static void do_head(int fd, char *name) { - int i, len, lines=TT.lines, bytes=TT.bytes; + int i, len, lines=TT.n, bytes=TT.c; if ((toys.optc > 1 && !(toys.optflags & FLAG_q)) || toys.optflags & FLAG_v) { // Print an extra newline for all but the first file @@ -65,7 +65,7 @@ void head_main(void) // handle old "-42" style arguments if (arg && *arg == '-' && arg[1]) { - TT.lines = atolx(arg+1); + TT.n = atolx(arg+1); toys.optc--; } else arg = 0; loopfiles(toys.optargs+!!arg, do_head); -- cgit v1.2.3