summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/head/head.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/head/head.c b/usr.bin/head/head.c
index e93896b..d262a95 100644
--- a/usr.bin/head/head.c
+++ b/usr.bin/head/head.c
@@ -65,8 +65,6 @@ void head_bytes __P((FILE *, int));
void obsolete __P((char *[]));
void usage __P((void));
-int eval;
-
int
main(argc, argv)
int argc;
@@ -74,7 +72,7 @@ main(argc, argv)
{
register int ch;
FILE *fp;
- int first, linecnt = -1, bytecnt = -1;
+ int first, linecnt = -1, bytecnt = -1, eval = 0;
char *ep;
obsolete(argv);
@@ -119,8 +117,7 @@ main(argc, argv)
head_bytes(fp, bytecnt);
(void)fclose(fp);
}
- }
- else if (bytecnt == -1)
+ } else if (bytecnt == -1)
head(stdin, linecnt);
else
head_bytes(stdin, bytecnt);
@@ -145,8 +142,8 @@ head(fp, cnt)
void
head_bytes(fp, cnt)
- FILE *fp;
- register int cnt;
+ FILE *fp;
+ register int cnt;
{
char buf[4096];
register int readlen;
@@ -187,6 +184,7 @@ obsolete(argv)
void
usage()
{
+
(void)fprintf(stderr, "usage: head [-n lines] [-c bytes] [file ...]\n");
exit(1);
}
OpenPOWER on IntegriCloud