From 829656c5fcd7169e4c2f86f4ad5098ea9aaa5643 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 13 Sep 2004 23:28:30 +0000 Subject: new configuration subsystem git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@198 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/modargs.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'polyp/modargs.c') diff --git a/polyp/modargs.c b/polyp/modargs.c index 4874d808..e1c2c9b8 100644 --- a/polyp/modargs.c +++ b/polyp/modargs.c @@ -36,6 +36,7 @@ #include "sink.h" #include "source.h" #include "xmalloc.h" +#include "util.h" struct pa_modargs; @@ -229,6 +230,7 @@ int pa_modargs_get_value_s32(struct pa_modargs *ma, const char *key, int32_t *va int pa_modargs_get_value_boolean(struct pa_modargs *ma, const char *key, int *value) { const char *v; + int r; assert(ma && key && value); if (!(v = pa_modargs_get_value(ma, key, NULL))) @@ -237,13 +239,10 @@ int pa_modargs_get_value_boolean(struct pa_modargs *ma, const char *key, int *va if (!*v) return -1; - if (!strcmp(v, "1") || !strcasecmp(v, "yes") || !strcasecmp(v, "y") || !strcasecmp(v, "on")) - *value = 1; - else if (!strcmp(v, "0") || !strcasecmp(v, "no") || !strcasecmp(v, "n") || !strcasecmp(v, "off")) - *value = 0; - else + if ((r = pa_parse_boolean(v)) < 0) return -1; + *value = r; return 0; } -- cgit