}
static int getresource_bool(const char *want, int def, int *cache) {
- /* *cache should be initialised to -1 and will be set to !!value */
+ /* *cache should be initialised to -1 and will be set to !!value
+ * alternatively cache==0 is allowed */
+
+ if (cache && *cache >= 0) return *cache;
- if (*cache >= 0) return *cache;
const char *str= getresource(want);
int result = def;
if (str && str[0]) {
}
}
}
- return *cache= result;
+
+ if (cache) *cache= result;
+ return result;
}
static void more_resources(const char *str, const char *why) {