id,summary,reporter,owner,description,type,status,priority,component,version,resolution,keywords,cc,game 3944,COMMON: readLine_NEW fails to read last line in file,salty-horse,wjp,"{{{#!Markdown Using latest svn r34343. If the last ""line"" in a file doesn't end with a newline, readLine\_NEW will return 0 instead of the real data. In my case, I am opening a file with Common::File::open\(\) and calling readLine\_NEW on it. Suppose the last characters of the file are 'a', 'b' followed by EOF. readLine\_NEW will execute ""c = readByte\(\);"" in common/stream.cpp:166 twice. After the third time, c will be '\0'. It then gets to the check: if \(ioFailed\(\) || \(len == 0 && eos\(\)\)\) return 0; ioFailed\(\) returns True and then 0 is returned, even if len > 0. Maybe the real problem is ioFailed returning 'true' when nothing is actually failing. It's set when readByte\(\) calls File::read\(&b, 1\). AFAIK, this doesn't actually cause any errors in existing engines. I've encountered it in my KoM engine. }}} {{{#!div style=""font-size: 75%"" Ticket imported from: !#2095303. Ticket imported from: bugs/3944. }}}",defect,closed,normal,--Other--,,fixed,,,