Skip to content

Commit

Permalink
Fix Windows line-ending issues
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dpwright committed Jan 26, 2014
1 parent 77e0b2b commit e728664
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/protoc-gen-ruby
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ rescue => error
]
$stderr.puts response.error
else
print response.to_s
$stdout.binmode
$stdout.print response.to_s
end

0 comments on commit e728664

Please sign in to comment.