mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-12 17:08:39 -09:00
Fix JSON export of "otherfs" excluded type
The exporter would write "othfs" while the import code was expecting "otherfs". This bug also exists in the 1.x branch and is probably as old as the JSON import/export feature. D'oh. Normalized the export to use "otherfs" now (which is what all versions can read correctly) and fixed the importer to also accept "othfs" (which is what all previous versions exported).
This commit is contained in:
parent
dc42c91619
commit
08d373881c
2 changed files with 2 additions and 2 deletions
|
|
@ -337,7 +337,7 @@ fn itemkey(ctx: *Ctx, key: []const u8) void {
|
|||
var buf: [32]u8 = undefined;
|
||||
const typ = ctx.p.string(&buf);
|
||||
// "frmlnk" is also possible, but currently considered equivalent to "pattern".
|
||||
if (eq(u8, typ, "otherfs")) ctx.special = .other_fs
|
||||
if (eq(u8, typ, "otherfs") or eq(u8, typ, "othfs")) ctx.special = .other_fs
|
||||
else if (eq(u8, typ, "kernfs")) ctx.special = .kernfs
|
||||
else ctx.special = .excluded;
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ const JsonWriter = struct {
|
|||
ctx.writeStr(name);
|
||||
ctx.write(switch (t) {
|
||||
.err => "\",\"read_error\":true}",
|
||||
.other_fs => "\",\"excluded\":\"othfs\"}",
|
||||
.other_fs => "\",\"excluded\":\"otherfs\"}",
|
||||
.kernfs => "\",\"excluded\":\"kernfs\"}",
|
||||
.excluded => "\",\"excluded\":\"pattern\"}",
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue