aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/head.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2018-08-26 14:16:49 -0500
committerRob Landley <rob@landley.net>2018-08-26 14:16:49 -0500
commit009b55edc4bad5b46ace88f3c255bbff8671d137 (patch)
treef4f856ef871104e37a5d123aa3ec3d01246c9e10 /toys/posix/head.c
parent1aaef2d2b72800a5c6bedae04941304ce8e153be (diff)
downloadtoybox-009b55edc4bad5b46ace88f3c255bbff8671d137.tar.gz
Convert more commands to the new option/GLOBALS code style.
Diffstat (limited to 'toys/posix/head.c')
-rw-r--r--toys/posix/head.c8
1 files changed, 4 insertions, 4 deletions
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);