aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2017-04-20 11:57:15 +0200
committerGitHub2017-04-20 11:57:15 +0200
commit67a0a89b100b36adec735601e90082eeef3456a1 (patch)
treedb2675a55d35766d5c5d6cedb22f88eae805a9c5 /Library
parent29d750df719ae2a84042481b05d1b744fa6a6d42 (diff)
parentd251be1eeb84022a28193d03a4f6ebcfaa1ed9ee (diff)
downloadbrew-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.rb15
-rwxr-xr-x[-rw-r--r--]Library/Homebrew/vendor/plist/plist/parser.rb5
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