scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit a12dfb2efd0750ae59a5d73a4989d29e9e0c0e48
parent e954d0a88f3ae65a707af607e8adf636f350365e
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 20 Feb 2018 16:20:16 +0000

[ar] Remove parameter of doit()

The call to openar() can be done in doit().

Diffstat:
Mar/main.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ar/main.c b/ar/main.c @@ -508,10 +508,11 @@ usage(void) } static void -doit(int key, FILE *fp, char *flist[]) +doit(int key, char *flist[]) { - FILE *tmp1, *tmp2; + FILE *tmp1, *tmp2, *fp; + fp = openar(); if (*flist == NULL && (key == 'r' || key == 'd' || key == 'm' || key == 'q')) { if (fclose(fp) == EOF) { @@ -650,7 +651,7 @@ main(int argc, char *argv[]) signal(SIGTERM, sigfun); arfile = *argv; - doit(key, openar(), argv+1); + doit(key, argv+1); if (fflush(stdout) == EOF) { perror("ar:error writing to stdout");