Skip to content

Commit e728664

Browse files
committed
Fix Windows line-ending issues
On Windows, any newlines printed to $stdout are automatically converted to "\r\n", which breaks the protocol buffer format. Switching $stdout to binary mode immediately before printing the file prevents this from happening.
1 parent 77e0b2b commit e728664

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/protoc-gen-ruby

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ rescue => error
2626
]
2727
$stderr.puts response.error
2828
else
29-
print response.to_s
29+
$stdout.binmode
30+
$stdout.print response.to_s
3031
end

0 commit comments

Comments
 (0)