[PATCH 2/4] config: fix boolean parsing
Pekka Paalanen
ppaalanen at gmail.com
Tue Nov 15 01:45:41 PST 2011
The rest of the line contains the newline, so cannot match simply 'true'
or 'false'.
Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
---
clients/config.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/clients/config.c b/clients/config.c
index 42acee7..be7b5db 100644
--- a/clients/config.c
+++ b/clients/config.c
@@ -54,9 +54,9 @@ handle_key(const struct config_key *key, const char *value)
return 0;
case CONFIG_KEY_BOOL:
- if (strcmp(value, "false") == 0)
+ if (strcmp(value, "false\n") == 0)
*(int *)key->data = 0;
- else if (strcmp(value, "true") == 0)
+ else if (strcmp(value, "true\n") == 0)
*(int *)key->data = 1;
else {
fprintf(stderr, "invalid bool: %s\n", value);
--
1.7.3.4
More information about the wayland-devel
mailing list