locationalias is case insensitive now

This commit is contained in:
Ianos Gnatiuc 2005-10-12 01:34:44 +00:00
parent fc011f01b9
commit 73b0d1b7d3
4 changed files with 20 additions and 7 deletions

View File

@ -79,6 +79,7 @@ LocationAlias Cheboxary
LocationAlias Cherkassy —¥àª ááë
LocationAlias Chistopol —¨á⮯®«
LocationAlias Chornobyl —¥à­®¡ë«ì
LocationAlias Dalmatovo „ «¬ â®¢®
LocationAlias Energodar <20>­¥à£®¤ à
LocationAlias Essentuky …áᥭâ㪨
LocationAlias Karaganda Š à £ ­¤ 
@ -100,7 +101,7 @@ LocationAlias Vasilyevo
LocationAlias Volgograd ‚®«£®£à ¤
LocationAlias Yaroslavl Ÿà®á« ¢«ì
LocationAlias Zapolarny ‡ ¯®«ïà­ë©
LocationAlias zarechniy ‡ à¥ç­ë©
LocationAlias Zarechniy ‡ à¥ç­ë©
LocationAlias Zhukovsky †ãª®¢áª¨©
LocationAlias Alma-Ata €«¬ -€â 
LocationAlias Belgorod <20>¥«£®à®¤
@ -135,6 +136,7 @@ LocationAlias Volzhsky
LocationAlias Voronezh ‚®à®­¥¦
LocationAlias Zauralie ‡ ãà «ì¥
LocationAlias Angarsk €­£ àáª
LocationAlias Armavir €à¬ ¢¨à
LocationAlias Barnaul <20> à­ ã«
LocationAlias Bendery <20>¥­¤¥àë
LocationAlias Borisov <20>®à¨á®¢
@ -146,7 +148,6 @@ LocationAlias Ivanovo
LocationAlias Izhevsk ˆ¦¥¢áª
LocationAlias Kharkov • à쪮¢
LocationAlias Kherson •¥àá®­
LocationAlias kherson •¥àá®­
LocationAlias Klichev Š«¨ç¥¢
LocationAlias Kolomna Š®«®¬­ 
LocationAlias Lipetsk ‹¨¯¥âáª
@ -176,7 +177,6 @@ LocationAlias Grodno
LocationAlias Kaluga Š «ã£ 
LocationAlias Ketovo Š¥â®¢®
LocationAlias Kobrin Š®¡à¨­
LocationAlias kurgan Šã࣠­
LocationAlias Kurgan Šã࣠­
LocationAlias Moscow Œ®áª¢ 
LocationAlias Odessa Ž¤¥áá 

View File

@ -10,6 +10,8 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________
+ LocationAlias is case insensitive now.
+ Macro '@widepid' contains platform ID again.
! Golded+ now may be compiled on 64bit platforms.

View File

@ -326,7 +326,7 @@ void CfgLocationalias()
getkeyval(&key, &val);
StripQuotes(key);
StripQuotes(val);
CFG->locationalias.Add(key, val);
CFG->locationalias.Add(strupr(key), val);
}
// ------------------------------------------------------------------

View File

@ -30,6 +30,10 @@
#include <gftnnlge.h>
#include <gftnnlv7.h>
#if defined(__USE_ALLOCA__)
#include <malloc.h>
#endif
// ------------------------------------------------------------------
@ -1141,12 +1145,19 @@ void LookupNodeLocation(GMsg* msg, std::string &location, int what)
if (strbag.First())
{
#if defined(__USE_ALLOCA__)
char *city_upr = (char*)alloca(city.length()+1);
#else
__extension__ char city_upr[city.length()+1];
#endif
strcpy(city_upr, city.c_str());
strupr(city_upr);
do
{
const char* str = strbag.Current1();
size_t pos = city.find(str);
if (pos != city.npos)
city.replace(pos, strlen(str), strbag.Current2());
const char* ptr = strstr(city_upr, str);
if (ptr) city.replace(ptr-city_upr, strlen(str), strbag.Current2());
}
while (strbag.Next());
}