diff --git a/Library/Homebrew/extend/io.rb b/Library/Homebrew/extend/io.rb index 1357293cdc..53bca196e1 100644 --- a/Library/Homebrew/extend/io.rb +++ b/Library/Homebrew/extend/io.rb @@ -1,10 +1,17 @@ class IO def readline_nonblock(sep = $INPUT_RECORD_SEPARATOR) + line = "" buffer = "" - buffer.concat(read_nonblock(1)) while buffer[-1] != sep - buffer + + loop do + break if buffer == sep + read_nonblock(1, buffer) + line.concat(buffer) + end + + line rescue IO::WaitReadable, EOFError => e - raise e if buffer.empty? - buffer + raise e if line.empty? + line end end diff --git a/Library/Homebrew/vendor/plist/plist/parser.rb b/Library/Homebrew/vendor/plist/plist/parser.rb old mode 100644 new mode 100755 index de441fcc50..7d8bfab07f --- a/Library/Homebrew/vendor/plist/plist/parser.rb +++ b/Library/Homebrew/vendor/plist/plist/parser.rb @@ -69,6 +69,11 @@ module Plist @xml = plist_data_or_file end + # TODO: Update vendored `plist` parser when + # https://github.com/patsplat/plist/pull/38 + # is merged. + @xml.force_encoding("UTF-8") + @listener = listener end