diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-01-30 00:25:44 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-01-30 00:25:44 +0000 |
commit | 741230435bd23aa692f552649664b67a43a358c0 (patch) | |
tree | 2f659f9ff3ed0c2b3df3119315047b6f756ef135 /src/common/strlib.c | |
parent | d21f2f8479c618c15958ae1f9ac5811b9b035921 (diff) | |
download | hercules-741230435bd23aa692f552649664b67a43a358c0.tar.gz hercules-741230435bd23aa692f552649664b67a43a358c0.tar.bz2 hercules-741230435bd23aa692f552649664b67a43a358c0.tar.xz hercules-741230435bd23aa692f552649664b67a43a358c0.zip |
* Merged changes from trunk [14636:14686/trunk].
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/renewal@14687 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/strlib.c')
-rw-r--r-- | src/common/strlib.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/common/strlib.c b/src/common/strlib.c index 019e2d629..a0cba906c 100644 --- a/src/common/strlib.c +++ b/src/common/strlib.c @@ -925,6 +925,7 @@ bool sv_readdb(const char* directory, const char* filename, char delim, int minc char** fields; // buffer for fields ([0] is reserved) int columns, fields_length; char path[1024], line[1024]; + char* match; snprintf(path, sizeof(path), "%s/%s", directory, filename); @@ -944,9 +945,12 @@ bool sv_readdb(const char* directory, const char* filename, char delim, int minc while( fgets(line, sizeof(line), fp) ) { lines++; - if( line[0] == '/' && line[1] == '/' ) - continue; - //TODO: strip trailing // comment + + if( ( match = strstr(line, "//") ) != NULL ) + {// strip comments + match[0] = 0; + } + //TODO: strip trailing whitespace if( line[0] == '\0' || line[0] == '\n' || line[0] == '\r') continue; |