# HG changeset patch # User zas_ # Date 1208216386 0 # Node ID ce00494827e2c155e756055efded9303f9b914c0 # Parent addd05a425fed6a6bcb948baf3f84e68585873e4 collection_load(): use booleans and always count failures (for debug). diff -r addd05a425fe -r ce00494827e2 src/collect-io.c --- 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);