change a global into a local, misc style fixes
This commit is contained in:
parent
a2d7281c5a
commit
c16b5e4f8a
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user