Commit 9ade2d08 authored by Olivier Bertrand's avatar Olivier Bertrand

- 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
parent f3e7e50d
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment