diff --git a/src/image.zig b/src/image.zig index ef27b7a..b9202ef 100644 --- a/src/image.zig +++ b/src/image.zig @@ -95,16 +95,12 @@ pub fn temporaryName(allocator: *std.mem.Allocator) ![]u8 { } // if we fail to access it, we assume it doesn't exist and return it. - var tmp_file: std.fs.File = std.fs.cwd().openFile( - nam, - .{ .read = true, .write = false }, - ) catch |err| blk: { - if (err == error.FileNotFound) return nam else continue; - }; - // if we actually found someone, close the handle so that we don't - // get EMFILE later on. - tmp_file.close(); + _ = std.fs.cwd().openFile(nam, .{ .read = true, .write = false }) catch |err| { + if (err == error.FileNotFound) { + return nam; + } + }; } return error.TempGenFail; diff --git a/src/main.zig b/src/main.zig index 7d6cc00..a2716d7 100644 --- a/src/main.zig +++ b/src/main.zig @@ -208,10 +208,6 @@ pub fn doRepl(allocator: *std.mem.Allocator, args_it: var) !void { std.debug.warn("repl: error while parsing: {}\n", .{err}); continue; }; - - // no command? ignore! - if (cmds_parsed.items.len == 0) continue; - current = cmds_parsed.items[0].*; // by cloning the parent runner, we can iteratively write @@ -224,7 +220,7 @@ pub fn doRepl(allocator: *std.mem.Allocator, args_it: var) !void { // of this function. try cmds.append(&runqs_cmd.base); - try runner_clone.runCommands(cmds, true); + try runner_clone.runCommands(cmds_parsed, true); _ = try stdout.write("\n"); } } diff --git a/src/printer.zig b/src/printer.zig index bf32f76..2302cfc 100644 --- a/src/printer.zig +++ b/src/printer.zig @@ -3,7 +3,6 @@ const langs = @import("lang.zig"); fn printCommandWithParams(stream: var, command: var) !void { const Parameters = @TypeOf(command.parameters); - try stream.print(" {} {}", .{ command.split, command.index }); inline for (@typeInfo(Parameters).Struct.fields) |field| { if (field.field_type == f32 or field.field_type == f64) { try stream.print(" {d}", .{@field(command.parameters, field.name)});