summaryrefslogtreecommitdiff
path: root/json.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-07-29 15:59:44 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-07-29 15:59:44 +0000
commit42bbb63a1b66ee64e297d432689833d970a16ed8 (patch)
tree78e76124e050f61aa5e94654a4b50ce4c25c7d45 /json.c
parent6a5a1aff88d18b55895714e2241237ed3abc6f1b (diff)
downloadgpsd-42bbb63a1b66ee64e297d432689833d970a16ed8.tar.gz
New-style WATCH command is working...
...at least for the simplest case ?WATCH={"TPV":true}. More testing will follow.
Diffstat (limited to 'json.c')
-rw-r--r--json.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/json.c b/json.c
index 2fbb09c5..283894f5 100644
--- a/json.c
+++ b/json.c
@@ -62,7 +62,9 @@ int json_read_object(const char *cp, const struct json_attr_t *attrs, int offset
cursor->addr.string.ptr[offset] = '\0';
break;
case boolean:
- cursor->addr.boolean[offset] = cursor->dflt.boolean;
+ /* nullbool default says not to set the value at all */
+ if (cursor->dflt.boolean != nullbool)
+ cursor->addr.boolean[offset] = cursor->dflt.boolean;
break;
case object: /* silences a compiler warning */
case array: