Skip to content

Commit

Permalink
fix windows build system
Browse files Browse the repository at this point in the history
broken by 6e82107
  • Loading branch information
andrewrk committed May 12, 2018
1 parent 277b9cf commit 4277762
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions std/os/child_process.zig
Expand Up @@ -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(' ');
Expand All @@ -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('"');
}

Expand Down

0 comments on commit 4277762

Please sign in to comment.