"on demand" option can also be referred as "auto", which is also the default for setting generation
Costa Tsaousis (ktsaou) committed
May 21, 2016 at 17:29 UTC
ec175c7f6eb71c40bd3fbd62bba915037f663dea
1 file changed
+4
-4
src/appconfig.c
+4
-4
@@ -242,8 +242,8 @@ int config_get_boolean(const char *section, const char *name, int value)
242
s = config_get(section, name, s);
243
if(!s) return value;
244
245
- if(!strcmp(s, "yes")) return 1;
246
- else return 0;
245
+ if(!strcmp(s, "yes") || !strcmp(s, "auto") || !strcmp(s, "on demand")) return 1;
246
+ return 0;
247
}
248
249
int config_get_boolean_ondemand(const char *section, const char *name, int value)
@@ -251,7 +251,7 @@ int config_get_boolean_ondemand(const char *section, const char *name, int value
251
char *s;
252
253
if(value == CONFIG_ONDEMAND_ONDEMAND)
254
- s = "on demand";
254
+ s = "auto";
255
256
else if(value == CONFIG_ONDEMAND_NO)
257
s = "no";
@@ -266,7 +266,7 @@ int config_get_boolean_ondemand(const char *section, const char *name, int value
266
return CONFIG_ONDEMAND_YES;
267
else if(!strcmp(s, "no"))
268
return CONFIG_ONDEMAND_NO;
269
- else if(!strcmp(s, "on demand"))
269
+ else if(!strcmp(s, "auto") || !strcmp(s, "on demand"))
270
return CONFIG_ONDEMAND_ONDEMAND;
271
272
return value;