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