shithub: scc

Download patch

ref: 59ec69003f284ff73480ce2724e50fe7ee178f98
parent: 8bc7d1659de95ce7d93c588821ff2f038918fb01
author: Roberto E. Vargas Caballero <[email protected]>
date: Mon Feb 19 10:30:20 EST 2018

[ar] Do always the check of pending members

If there is some member in the list of members for some operation
then ar must fail.

--- a/ar/main.c
+++ b/ar/main.c
@@ -532,10 +532,6 @@
 		tmp1 = opentmp("ar.tmp1", &tmpafile1);
 		run(fp, tmp1, NULL, flist, update);
 
-		if (*flist == NULL) {
-			closetmp(tmp1, &tmpafile1, afile);
-			break;
-		}
 		if (!posname) {
 			append(tmp1, flist);
 			break;
@@ -569,10 +565,6 @@
 		tmp2 = opentmp("ar.tmp2", &tmpafile2);
 		run(fp, tmp1, tmp2, flist, split);
 
-		if (*flist) {
-			fprintf(stderr, "ar: entry '%s' not found\n", *flist);
-			exit(1);
-		}
 		fp = openar(afile);
 		fseek(tmp1, SARMAG, SEEK_SET);
 		fseek(tmp2, SARMAG, SEEK_SET);
@@ -585,7 +577,12 @@
 		closetmp(tmp2, &tmpafile2, NULL);
 		break;
 	}
+	if (*flist == NULL)
+		return;
 
+	while (*flist)
+		fprintf(stderr, "ar: No member named '%s\n", *flist++);
+	exit(1);
 }
 
 int