From f09707bb9ea08e32d849ae2019d16cd7e14606a7 Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Wed, 23 Apr 2008 11:14:45 +0000 Subject: * 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 --- src/map/script.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/map') 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++); -- cgit v1.2.3-70-g09d2