Ruby mogilefs-client dev/users discussion/patches/bugs/help/...
 help / color / mirror / code / Atom feed
* [PATCH] backend: simplify regexp
@ 2015-11-04 21:43 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-11-04 21:43 UTC (permalink / raw)
  To: mogilefs-client-public

We don't care if there's a \r before \n if we anchor on \z.
---
 lib/mogilefs/backend.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/mogilefs/backend.rb b/lib/mogilefs/backend.rb
index 01203f6..f4d5b1f 100644
--- a/lib/mogilefs/backend.rb
+++ b/lib/mogilefs/backend.rb
@@ -242,7 +242,7 @@ class MogileFS::Backend
       begin
         io = dispatch_unlocked(request)
         line = io.timed_gets(@timeout)
-        break if /\r?\n\z/ =~ line
+        break if /\n\z/ =~ line
 
         line and raise MogileFS::InvalidResponseError,
                        "Invalid response from server: #{line.inspect}"
-- 
EW


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-04 21:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-04 21:43 [PATCH] backend: simplify regexp Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/mogilefs-client.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).