mirror of
https://github.com/ziglang/zig.git
synced 2026-02-18 15:31:48 +00:00
fix windows build system
broken by 6e821078f625a03eb8b7794c983da0f7793366ab
This commit is contained in:
parent
277b9cf878
commit
4277762b74
@ -650,6 +650,8 @@ fn windowsCreateCommandLine(allocator: &mem.Allocator, argv: []const []const u8)
|
||||
var buf = try Buffer.initSize(allocator, 0);
|
||||
defer buf.deinit();
|
||||
|
||||
var buf_stream = &io.BufferOutStream.init(&buf).stream;
|
||||
|
||||
for (argv) |arg, arg_i| {
|
||||
if (arg_i != 0)
|
||||
try buf.appendByte(' ');
|
||||
@ -663,18 +665,18 @@ fn windowsCreateCommandLine(allocator: &mem.Allocator, argv: []const []const u8)
|
||||
switch (byte) {
|
||||
'\\' => backslash_count += 1,
|
||||
'"' => {
|
||||
try buf.appendByteNTimes('\\', backslash_count * 2 + 1);
|
||||
try buf_stream.writeByteNTimes('\\', backslash_count * 2 + 1);
|
||||
try buf.appendByte('"');
|
||||
backslash_count = 0;
|
||||
},
|
||||
else => {
|
||||
try buf.appendByteNTimes('\\', backslash_count);
|
||||
try buf_stream.writeByteNTimes('\\', backslash_count);
|
||||
try buf.appendByte(byte);
|
||||
backslash_count = 0;
|
||||
},
|
||||
}
|
||||
}
|
||||
try buf.appendByteNTimes('\\', backslash_count * 2);
|
||||
try buf_stream.writeByteNTimes('\\', backslash_count * 2);
|
||||
try buf.appendByte('"');
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user