diff options
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/json.c b/src/json.c index eedb6062a..64ef93fab 100644 --- a/src/json.c +++ b/src/json.c @@ -193,11 +193,17 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID, int options) switch (val->v_type) { - case VAR_SPECIAL: + case VAR_BOOL: switch (val->vval.v_number) { case VVAL_FALSE: ga_concat(gap, (char_u *)"false"); break; case VVAL_TRUE: ga_concat(gap, (char_u *)"true"); break; + } + break; + + case VAR_SPECIAL: + switch (val->vval.v_number) + { case VVAL_NONE: if ((options & JSON_JS) != 0 && (options & JSON_NO_NONE) == 0) // empty item @@ -818,7 +824,7 @@ json_decode_item(js_read_T *reader, typval_T *res, int options) reader->js_used += 5; if (cur_item != NULL) { - cur_item->v_type = VAR_SPECIAL; + cur_item->v_type = VAR_BOOL; cur_item->vval.v_number = VVAL_FALSE; } retval = OK; @@ -829,7 +835,7 @@ json_decode_item(js_read_T *reader, typval_T *res, int options) reader->js_used += 4; if (cur_item != NULL) { - cur_item->v_type = VAR_SPECIAL; + cur_item->v_type = VAR_BOOL; cur_item->vval.v_number = VVAL_TRUE; } retval = OK; |