scc

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

commit d0a5ed5e8176cd8e848f54d5784bed68ed361cec
parent 660a78071126ab31e2b4b5d787225b8e56f5cf6a
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 19 Feb 2018 15:30:20 +0000

[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.

Diffstat:
Mar/main.c | 13+++++--------
1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/ar/main.c b/ar/main.c @@ -532,10 +532,6 @@ doit(int key, char *afile, FILE *fp, char *flist[]) 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 @@ doit(int key, char *afile, FILE *fp, char *flist[]) 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 @@ doit(int key, char *afile, FILE *fp, char *flist[]) closetmp(tmp2, &tmpafile2, NULL); break; } + if (*flist == NULL) + return; + while (*flist) + fprintf(stderr, "ar: No member named '%s\n", *flist++); + exit(1); } int