diff src/collect-io.c @ 366:ce00494827e2

collection_load(): use booleans and always count failures (for debug).
author zas_
date Mon, 14 Apr 2008 23:39:46 +0000
parents addd05a425fe
children 2649a28d31b6
line wrap: on
line diff
--- a/src/collect-io.c	Mon Apr 14 23:29:54 2008 +0000
+++ b/src/collect-io.c	Mon Apr 14 23:39:46 2008 +0000
@@ -67,9 +67,9 @@
 	guint fail = 0;
 	gboolean changed = FALSE;
 	CollectManagerEntry *entry = NULL;
-	guint flush = flags & COLLECTION_LOAD_FLUSH;
-	guint append = flags & COLLECTION_LOAD_APPEND;
-	guint only_geometry = flags & COLLECTION_LOAD_GEOMETRY;
+	guint flush = !!(flags & COLLECTION_LOAD_FLUSH);
+	guint append = !!(flags & COLLECTION_LOAD_APPEND);
+	guint only_geometry = !!(flags & COLLECTION_LOAD_GEOMETRY);
 
 	if (!only_geometry)
 		{
@@ -159,10 +159,11 @@
 			g_free(buf);
 
 			total++;
-			if (!valid && limit_failures)
+			if (!valid)
 				{
 				fail++;
-				if (fail > GQ_COLLECTION_FAIL_MIN &&
+				if (limit_failures &&
+				    fail > GQ_COLLECTION_FAIL_MIN &&
 				    fail * 100 / total > GQ_COLLECTION_FAIL_PERCENT)
 					{
 					printf("%d invalid filenames in unoffical collection file, closing: %s\n", fail, path);