From cc572e377c9db289aab411503c5ea1c190499a81 Mon Sep 17 00:00:00 2001 From: Alexey Smolianinov Date: Tue, 31 May 2011 00:52:04 +0400 Subject: [PATCH] Improved check for possibility of EOL auto-discover --- lib/faster_csv.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/faster_csv.rb b/lib/faster_csv.rb index b4fd78a..088e372 100644 --- a/lib/faster_csv.rb +++ b/lib/faster_csv.rb @@ -1743,7 +1743,7 @@ def init_separators(options) # automatically discover row separator when requested if @row_sep == :auto - if !@io.respond_to?(:eof?) or (@io.eof? rescue true) # we can't auto-discover for STDOUT, STDERR, Zlib::GzipWriter streems, etc + if !@io.respond_to?(:pos) or !@io.respond_to?(:eof?) or (@io.eof? rescue true) # we can't auto-discover for STDOUT, STDERR, Zlib::GzipWriter streems, etc @row_sep = $INPUT_RECORD_SEPARATOR else begin