diff options
author | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-04-23 11:14:45 +0000 |
---|---|---|
committer | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-04-23 11:14:45 +0000 |
commit | f09707bb9ea08e32d849ae2019d16cd7e14606a7 (patch) | |
tree | 0e081f4e99d4d99c9a2f96b5eade70924f7f65f9 /src/map | |
parent | 4e45ec34bb37eb515480cfc42dce7d7380a5e235 (diff) | |
download | hercules-f09707bb9ea08e32d849ae2019d16cd7e14606a7.tar.gz hercules-f09707bb9ea08e32d849ae2019d16cd7e14606a7.tar.bz2 hercules-f09707bb9ea08e32d849ae2019d16cd7e14606a7.tar.xz hercules-f09707bb9ea08e32d849ae2019d16cd7e14606a7.zip |
* Fixed script strings not being handled properly (only skipped the \).
* Added skip_escaped_c to strlib.c/h.
* Fixed sv_unescape_c not handling hex/octal escapes properly.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12639 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/script.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c index 236bcf71e..6c2f30c55 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -921,7 +921,16 @@ const char* parse_simpleexpr(const char *p) p++; while( *p && *p != '"' ){ if( (unsigned char)p[-1] <= 0x7e && *p == '\\' ) - p++; + { + char buf[8]; + size_t len = skip_escaped_c(p) - p; + size_t n = sv_unescape_c(buf, p, len); + if( n != 1 ) + ShowDebug("parse_simpleexpr: unexpected length %d after unescape (\"%.*s\" -> %.*s)\n", (int)n, (int)len, p, (int)n, buf); + p += len; + add_scriptb(*buf); + continue; + } else if( *p == '\n' ) disp_error_message("parse_simpleexpr: unexpected newline @ string",p); add_scriptb(*p++); |