From 4265dc8dd0e680d29ed97294b9e698c7675df4e8 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Tue, 21 Jul 2009 16:18:18 -0700 Subject: Return true if response is a blank string. --- mpdlib.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mpdlib.rb b/mpdlib.rb index b452e9e..b8e9818 100644 --- a/mpdlib.rb +++ b/mpdlib.rb @@ -30,11 +30,14 @@ class MPD while true line = @socket.gets - return response if line == "OK\n" + break if line == "OK\n" return false if line =~ /^ACK/ response << line end + + return true if response.empty? + return response end def generate_hash str -- cgit v1.2.3-70-g09d2