Pārlūkot izejas kodu

- Fixed the script engine not parsing strings in multibyte charsets correctly (should have been done in r9532).
Ref: http://www.eathena.ws/board/index.php?showtopic=132004

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9642 54d463be-8e91-2dee-dedb-b68131a5f0ec

FlavioJS 18 gadi atpakaļ
vecāks
revīzija
8d7a0bd454
2 mainītis faili ar 5 papildinājumiem un 3 dzēšanām
  1. 2 0
      Changelog-Trunk.txt
  2. 3 3
      src/map/script.c

+ 2 - 0
Changelog-Trunk.txt

@@ -4,6 +4,8 @@ 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.
 
 2007/01/11
+	* Fixed the script engine not parsing strings in multibyte charsets 
+	  correctly (should have been done in r9532).
 	* Console plugin working when built as Windows native. [FlavioJS]
 2007/01/10
 	* Combined most of the txt/sql mobdb reading code [ultramage]

+ 3 - 3
src/map/script.c

@@ -723,10 +723,10 @@ const char* parse_simpleexpr(const char *p)
 	} else if(*p=='"'){
 		add_scriptc(C_STR);
 		p++;
-		while(*p && *p!='"'){
-			if(p[-1]<=0x7e && *p=='\\')
+		while( *p && *p != '"' ){
+			if( (unsigned char)p[-1] <= 0x7e && *p == '\\' )
 				p++;
-			else if(*p=='\n')
+			else if( *p == '\n' )
 				disp_error_message("parse_simpleexpr: unexpected newline @ string",p);
 			add_scriptb(*p++);
 		}