From 9ade2d088d12f6a2a6f901148ed72a45dd15e9ff Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sun, 9 Nov 2014 14:18:44 +0100 Subject: - FIX ftell error when the line endings do not match the declared or default ending. Also takes care of files having mixed line endings. This is done by never using text mode for streams and handle the line endings in reading and writing. (MDEV-7030) modified: storage/connect/filamtxt.cpp --- storage/connect/filamtxt.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/storage/connect/filamtxt.cpp b/storage/connect/filamtxt.cpp index a1bcc464e06..29b9f27e0d3 100644 --- a/storage/connect/filamtxt.cpp +++ b/storage/connect/filamtxt.cpp @@ -537,7 +537,8 @@ bool DOSFAM::OpenTableFile(PGLOBAL g) PDBUSER dbuserp = PlgGetUser(g); // This is required when using Unix files under Windows and vice versa - Bin = (Blocked || Ending != CRLF); +//Bin = (Blocked || Ending != CRLF); + Bin = true; // To void ftell problems switch (mode) { case MODE_READ: @@ -683,7 +684,7 @@ bool DOSFAM::RecordPos(PGLOBAL g) { if ((Fpos = ftell(Stream)) < 0) { sprintf(g->Message, MSG(FTELL_ERROR), 0, strerror(errno)); - strcat(g->Message, " (possible wrong ENDING option value)"); +// strcat(g->Message, " (possible wrong ENDING option value)"); return true; } // endif Fpos -- cgit v1.2.1