eb640f2
From 0618ad68a289b10bcc0c5fdbc8a0c8fa71542e4d Mon Sep 17 00:00:00 2001
eb640f2
From: =?UTF-8?q?Rapha=C3=ABl=20Droz?= <raphael.droz+floss@gmail.com>
eb640f2
Date: Sun, 27 Mar 2016 17:05:44 -0300
eb640f2
Subject: [PATCH 1/3] fixed bug #6
eb640f2
eb640f2
---
eb640f2
 filter.c | 4 +++-
eb640f2
 1 file changed, 3 insertions(+), 1 deletion(-)
eb640f2
eb640f2
diff --git a/filter.c b/filter.c
eb640f2
index 2cb145c..5ae7bd6 100644
eb640f2
--- a/filter.c
eb640f2
+++ b/filter.c
eb640f2
@@ -435,8 +435,10 @@ e_write_file(char *filename, int (*func) (FILE *in, struct db_enumerator e),
eb640f2
 	if((out = fopen(filename, "a")) == NULL)
eb640f2
 		return 1;
eb640f2
 
eb640f2
-	if(ftell(out))
eb640f2
+	if(ftell(out)) {
eb640f2
+		fclose(out);
eb640f2
 		return 1;
eb640f2
+	}
eb640f2
 
eb640f2
 	ret = (*func) (out, enumerator);
eb640f2
 
eb640f2
-- 
eb640f2
2.13.5
eb640f2