diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/extend/io.rb | 15 | ||||
| -rwxr-xr-x[-rw-r--r--] | Library/Homebrew/vendor/plist/plist/parser.rb | 5 |
2 files changed, 16 insertions, 4 deletions
diff --git a/Library/Homebrew/extend/io.rb b/Library/Homebrew/extend/io.rb index 1357293cd..53bca196e 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 index de441fcc5..7d8bfab07 100644..100755 --- 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 |
