diff options
author | alfred <alfred@FreeBSD.org> | 2001-11-02 09:21:11 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2001-11-02 09:21:11 +0000 |
commit | 558e29c5a0ae66dc14467414542d2daeaa572d78 (patch) | |
tree | 49722d72e63e54d4398381ef0dd11c4dff5de780 /usr.bin/head/head.c | |
parent | e3965fc866a9d9948ee38c0c5746d1b5af581b7a (diff) | |
download | FreeBSD-src-558e29c5a0ae66dc14467414542d2daeaa572d78.zip FreeBSD-src-558e29c5a0ae66dc14467414542d2daeaa572d78.tar.gz |
change a global into a local, misc style fixes
Diffstat (limited to 'usr.bin/head/head.c')
-rw-r--r-- | usr.bin/head/head.c | 12 |
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); } |