mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-11-03 21:49:42 -09:00
Zig 0.16: Add a global var io
This commit is contained in:
parent
f3aa967f84
commit
44b4eeaf24
1 changed files with 4 additions and 1 deletions
|
|
@ -61,6 +61,8 @@ pub const allocator = std.mem.Allocator{
|
|||
},
|
||||
};
|
||||
|
||||
pub var io: std.Io = undefined;
|
||||
|
||||
|
||||
// Custom panic impl to reset the terminal before spewing out an error message.
|
||||
pub const panic = std.debug.FullPanic(struct {
|
||||
|
|
@ -331,7 +333,7 @@ fn tryReadArgsFile(path: [:0]const u8) void {
|
|||
defer f.close();
|
||||
|
||||
var line_buf: [4096]u8 = undefined;
|
||||
var line_rd = util.LineReader.init(f, &line_buf);
|
||||
var line_rd = util.LineReader.init(io, f, &line_buf);
|
||||
|
||||
while (true) {
|
||||
const line_ = (line_rd.read() catch |e|
|
||||
|
|
@ -464,6 +466,7 @@ fn readImport(path: [:0]const u8) !void {
|
|||
}
|
||||
|
||||
pub fn main(init: std.process.Init) void {
|
||||
io = init.io;
|
||||
ui.main_thread = std.Thread.getCurrentId();
|
||||
|
||||
// Grab thousands_sep from the current C locale.
|
||||
|
|
|
|||
Loading…
Reference in a new issue