mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-12 17:08:39 -09:00
dir_import: Accept JSON data after the last object
This should really have been accepted from the start. Adding extra elements to the top-level array might be useful for aux. data related to the scanned files, e.g. map of seen uid/gids to names, information about the scanned dev ids, etc. But since ncdu would throw an error on further array elements, adding such information can't be done without breaking compat with older versions. :(
This commit is contained in:
parent
ca51d4ed1a
commit
e278660464
1 changed files with 8 additions and 2 deletions
|
|
@ -568,8 +568,14 @@ static int item(uint64_t dev) {
|
|||
|
||||
|
||||
static int footer(void) {
|
||||
C(cons());
|
||||
E(*ctx->buf != ']', "Expected ']'");
|
||||
while(1) {
|
||||
C(cons());
|
||||
if(*ctx->buf == ']')
|
||||
break;
|
||||
E(*ctx->buf != ',', "Expected ',' or ']'");
|
||||
con(1);
|
||||
C(cons() || rval());
|
||||
}
|
||||
con(1);
|
||||
C(cons());
|
||||
E(*ctx->buf, "Trailing garbage");
|
||||
|
|
|
|||
Loading…
Reference in a new issue