commit 660a78071126ab31e2b4b5d787225b8e56f5cf6a
parent a41d347ad47938dbe4ebcc595a60adf489f94b3a
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Mon, 19 Feb 2018 15:12:28 +0000
[ar] Enable early close for -q
If we don't have parameters is a good idea to do nothing.
Diffstat:
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/ar/main.c b/ar/main.c
@@ -518,7 +518,8 @@ doit(int key, char *afile, FILE *fp, char *flist[])
{
FILE *tmp1, *tmp2;
- if (*flist == NULL && (key == 'r' || key == 'd' || key == 'm')) {
+ if (*flist == NULL &&
+ (key == 'r' || key == 'd' || key == 'm' || key == 'q')) {
if (fclose(fp) == EOF) {
perror("ar:early close of archive file");
exit(-1);
diff --git a/tests/ar/execute/00-test-q.sh b/tests/ar/execute/00-test-q.sh
@@ -4,12 +4,7 @@ exec >> test.log 2>&1
set -e
-TZ=UTC
-tmp1=`mktemp`
-tmp2=`mktemp`
-pwd=$PWD
-
-trap "rm -f $tmp1 $tmp2 file.a;\
+trap "rm -f file.a;\
rm -f *.tst" 0 2 3
###########################################################################