summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2014-11-09 14:18:44 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2014-11-09 14:18:44 +0100
commit9ade2d088d12f6a2a6f901148ed72a45dd15e9ff (patch)
treeae21d0b4feac246f18638752966b6b600a812423
parentf3e7e50d9a979cf012390d31acc021801e2d3fa6 (diff)
downloadmariadb-git-9ade2d088d12f6a2a6f901148ed72a45dd15e9ff.tar.gz
- 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
-rw-r--r--storage/connect/filamtxt.cpp5
1 files 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