shithub: scc

Download patch

ref: 0f302f9cf00efa7c79f268cf1df4c71e113e0594
parent: 99605c45f8a60733579b474e7491314442a60843
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Feb 20 11:20:16 EST 2018

[ar] Remove parameter of doit()

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

--- a/ar/main.c
+++ b/ar/main.c
@@ -508,10 +508,11 @@
 }
 
 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 @@
 	signal(SIGTERM, sigfun);
 
 	arfile = *argv;
-	doit(key, openar(), argv+1);
+	doit(key, argv+1);
 
 	if (fflush(stdout) == EOF) {
 		perror("ar:error writing to stdout");