diff options
| author | Markus Reiter | 2017-04-20 11:57:15 +0200 |
|---|---|---|
| committer | GitHub | 2017-04-20 11:57:15 +0200 |
| commit | 67a0a89b100b36adec735601e90082eeef3456a1 (patch) | |
| tree | db2675a55d35766d5c5d6cedb22f88eae805a9c5 /Library | |
| parent | 29d750df719ae2a84042481b05d1b744fa6a6d42 (diff) | |
| parent | d251be1eeb84022a28193d03a4f6ebcfaa1ed9ee (diff) | |
| download | brew-67a0a89b100b36adec735601e90082eeef3456a1.tar.bz2 | |
Merge pull request #2511 from reitermarkus/fix-plist-parser
Fix `plist` parser failing when encoded with ASCII.
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 |
