| ... | @@ -650,6 +650,8 @@ fn windowsCreateCommandLine(allocator: &mem.Allocator, argv: []const []const u8) | ... | @@ -650,6 +650,8 @@ fn windowsCreateCommandLine(allocator: &mem.Allocator, argv: []const []const u8) |
| 650 | var buf = try Buffer.initSize(allocator, 0); | 650 | var buf = try Buffer.initSize(allocator, 0); |
| 651 | defer buf.deinit(); | 651 | defer buf.deinit(); |
| 652 | | 652 | |
| | 653 | var buf_stream = &io.BufferOutStream.init(&buf).stream; |
| | 654 | |
| 653 | for (argv) |arg, arg_i| { | 655 | for (argv) |arg, arg_i| { |
| 654 | if (arg_i != 0) | 656 | if (arg_i != 0) |
| 655 | try buf.appendByte(' '); | 657 | try buf.appendByte(' '); |
| ... | @@ -663,18 +665,18 @@ fn windowsCreateCommandLine(allocator: &mem.Allocator, argv: []const []const u8) | ... | @@ -663,18 +665,18 @@ fn windowsCreateCommandLine(allocator: &mem.Allocator, argv: []const []const u8) |
| 663 | switch (byte) { | 665 | switch (byte) { |
| 664 | '\\' => backslash_count += 1, | 666 | '\\' => backslash_count += 1, |
| 665 | '"' => { | 667 | '"' => { |
| 666 | try buf.appendByteNTimes('\\', backslash_count * 2 + 1); | 668 | try buf_stream.writeByteNTimes('\\', backslash_count * 2 + 1); |
| 667 | try buf.appendByte('"'); | 669 | try buf.appendByte('"'); |
| 668 | backslash_count = 0; | 670 | backslash_count = 0; |
| 669 | }, | 671 | }, |
| 670 | else => { | 672 | else => { |
| 671 | try buf.appendByteNTimes('\\', backslash_count); | 673 | try buf_stream.writeByteNTimes('\\', backslash_count); |
| 672 | try buf.appendByte(byte); | 674 | try buf.appendByte(byte); |
| 673 | backslash_count = 0; | 675 | backslash_count = 0; |
| 674 | }, | 676 | }, |
| 675 | } | 677 | } |
| 676 | } | 678 | } |
| 677 | try buf.appendByteNTimes('\\', backslash_count * 2); | 679 | try buf_stream.writeByteNTimes('\\', backslash_count * 2); |
| 678 | try buf.appendByte('"'); | 680 | try buf.appendByte('"'); |
| 679 | } | 681 | } |
| 680 | | 682 | |