scc

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

commit c5655a0a401ede745de6547c5f1db733612205ce
parent a46afb38ad256f2a2a202f9e92e4c0ee663814df
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 22 Feb 2018 15:20:43 +0000

[ar] Fix extract()

It was closing the input file which was closed in doit().

Diffstat:
Mar/main.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ar/main.c b/ar/main.c @@ -275,7 +275,7 @@ extract(struct member *m, int argc, char *argv[]) while (siz-- > 0 && (c = getc(m->src)) != EOF) putc(c, fp); fflush(fp); - if (fclose(m->src) == EOF || ferror(fp)) + if (fclose(fp) == EOF) goto error_file; /* TODO: set attributes */