diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-07-30 03:19:35 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-07-30 03:19:35 +0000 |
commit | 2bf514e9c2c17de4873a238f2a4a4c2a052571a8 (patch) | |
tree | bfad7b253edd473e769b80cfa0530d3f3e0f68bb | |
parent | 68b3507828409d55fb856dff6b58f8fd93f6bbd0 (diff) | |
download | hercules-2bf514e9c2c17de4873a238f2a4a4c2a052571a8.tar.gz hercules-2bf514e9c2c17de4873a238f2a4a4c2a052571a8.tar.bz2 hercules-2bf514e9c2c17de4873a238f2a4a4c2a052571a8.tar.xz hercules-2bf514e9c2c17de4873a238f2a4a4c2a052571a8.zip |
AccountDB_TXT will now correctly read inconsistent EOLs (bugreport:1934)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13015 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 1 | ||||
-rw-r--r-- | src/login/account_txt.c | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 740e1369c..acc21545e 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2008/07/30 + * AccountDB_TXT will now correctly read inconsistent EOLs (bugreport:1934) * Removed the IRC bot system, now a customization (see topic:194306) 2008/07/29 * Renamed struct 'skill' to 's_skill' to remove naming collisions. diff --git a/src/login/account_txt.c b/src/login/account_txt.c index cfcb6fb8f..23231d810 100644 --- a/src/login/account_txt.c +++ b/src/login/account_txt.c @@ -127,13 +127,13 @@ static bool account_db_txt_init(AccountDB* self) if( line[0] == '/' && line[1] == '/' ) continue; - if( sscanf(line, "%d%n", &v, &n) == 1 && line[n] == '\n' ) + if( sscanf(line, "%d%n", &v, &n) == 1 && (line[n] == '\n' || line[n] == '\r') ) {// format version definition version = v; continue; } - if( sscanf(line, "%d\t%%newid%%%n", &account_id, &n) == 1 && line[n] == '\n' ) + if( sscanf(line, "%d\t%%newid%%%n", &account_id, &n) == 1 && (line[n] == '\n' || line[n] == '\r') ) {// auto-increment if( account_id > db->next_account_id ) db->next_account_id = account_id; @@ -451,7 +451,7 @@ static bool mmo_auth_fromstr(struct mmo_account* a, char* str, unsigned int vers memset(a, 0x00, sizeof(struct mmo_account)); // extract tab-separated columns from line - count = sv_split(str, strlen(str), 0, '\t', fields, ARRAYLENGTH(fields), SV_NOESCAPE_NOTERMINATE); + count = sv_split(str, strlen(str), 0, '\t', fields, ARRAYLENGTH(fields), (e_svopt)(SV_TERMINATE_LF|SV_TERMINATE_CRLF)); if( version == ACCOUNT_TXT_DB_VERSION && count == 13 ) { |