Fixed a "bug" in sv_readdb under windows and cygwin configured as "Unix/binary" for text files ('\r' is read and empty lines are not skipped) bugreport:1382 bugreport:1401

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12634 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
toms 2008-04-22 15:13:32 +00:00
parent c880052f0f
commit 4c74bd7ac6
2 changed files with 4 additions and 1 deletions

View File

@ -3,6 +3,9 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2008/04/22
* Fixed a "bug" in sv_readdb under windows and cygwin configured as "Unix/binary" for text
files ('\r' is read and empty lines are not skipped) bugreport:1382 bugreport:1401 [Toms]
2008/04/21 2008/04/21
* Changed the data field of timers from int to intptr. * Changed the data field of timers from int to intptr.
* Added intptr/uintptr to cbasetypes.h (integers with the same size as a pointer). [FlavioJS] * Added intptr/uintptr to cbasetypes.h (integers with the same size as a pointer). [FlavioJS]

View File

@ -829,7 +829,7 @@ bool sv_readdb(const char* directory, const char* filename, char delim, int minc
continue; continue;
//TODO: strip trailing // comment //TODO: strip trailing // comment
//TODO: strip trailing whitespace //TODO: strip trailing whitespace
if( line[0] == '\0' || line[0] == '\n' ) if( line[0] == '\0' || line[0] == '\n' || line[0] == '\r')
continue; continue;
columns = sv_split(line, strlen(line), 0, delim, fields, ARRAYLENGTH(fields), (e_svopt)(SV_TERMINATE_LF|SV_TERMINATE_CRLF)); columns = sv_split(line, strlen(line), 0, delim, fields, ARRAYLENGTH(fields), (e_svopt)(SV_TERMINATE_LF|SV_TERMINATE_CRLF));