From 0cd6e08ca36629b72fd62ea7749504344c8c06ec Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 20 Mar 2023 15:51:27 -0700 Subject: [PATCH] if no argv, then don't load CLI args --- src/config.zig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/config.zig b/src/config.zig index be7f8c83f..527ac54cb 100644 --- a/src/config.zig +++ b/src/config.zig @@ -562,6 +562,13 @@ pub const Config = struct { /// Load and parse the CLI args. pub fn loadCliArgs(self: *Config, alloc_gpa: Allocator) !void { + switch (builtin.os.tag) { + .windows => {}, + + // Fast-path if we are non-Windows and no args, do nothing. + else => if (std.os.argv.len <= 1) return, + } + // Parse the config from the CLI args var iter = try std.process.argsWithAllocator(alloc_gpa); defer iter.deinit();