mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-15 10:18:39 -09:00
Fix crash on invalid utf8 when scanning in -1 UI mode
This commit is contained in:
parent
a4484f27f3
commit
6db150cc98
1 changed files with 2 additions and 2 deletions
|
|
@ -1089,12 +1089,12 @@ pub fn draw() void {
|
||||||
line = "\x1b7\x1b[JCounting hardlinks...\x1b8";
|
line = "\x1b7\x1b[JCounting hardlinks...\x1b8";
|
||||||
} else if (active_context.parents == null) {
|
} else if (active_context.parents == null) {
|
||||||
line = std.fmt.bufPrint(&buf, "\x1b7\x1b[J{s: <63} {d:>9} files\x1b8",
|
line = std.fmt.bufPrint(&buf, "\x1b7\x1b[J{s: <63} {d:>9} files\x1b8",
|
||||||
.{ ui.shorten(active_context.pathZ(), 63), active_context.items_seen }
|
.{ ui.shorten(ui.toUtf8(active_context.pathZ()), 63), active_context.items_seen }
|
||||||
) catch return;
|
) catch return;
|
||||||
} else {
|
} else {
|
||||||
const r = ui.FmtSize.fmt(util.blocksToSize(model.root.entry.pack.blocks));
|
const r = ui.FmtSize.fmt(util.blocksToSize(model.root.entry.pack.blocks));
|
||||||
line = std.fmt.bufPrint(&buf, "\x1b7\x1b[J{s: <51} {d:>9} files / {s}{s}\x1b8",
|
line = std.fmt.bufPrint(&buf, "\x1b7\x1b[J{s: <51} {d:>9} files / {s}{s}\x1b8",
|
||||||
.{ ui.shorten(active_context.pathZ(), 51), active_context.items_seen, r.num(), r.unit }
|
.{ ui.shorten(ui.toUtf8(active_context.pathZ()), 51), active_context.items_seen, r.num(), r.unit }
|
||||||
) catch return;
|
) catch return;
|
||||||
}
|
}
|
||||||
const stderr = std.io.getStdErr();
|
const stderr = std.io.getStdErr();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue