moved non-win32 CharNextExA implementation to util.cpp

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5208 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2007-07-18 19:18:00 +00:00
parent 9d1ab6f1ae
commit 3e9377d5b2
3 changed files with 19 additions and 16 deletions

View file

@ -466,22 +466,7 @@ int CEXEBuild::preprocess_string(char *out, const char *in, WORD codepage/*=CP_A
const char *p=in;
while (*p)
{
const char *np;
#ifdef _WIN32
np = CharNextExA(codepage, p, 0);
#else
{
char buf[1024];
snprintf(buf, 1024, "CP%d", codepage);
setlocale(LC_CTYPE, buf);
int len = mblen(p, strlen(p));
if (len > 0)
np = p + len;
else
np = p + 1;
setlocale(LC_CTYPE, "");
}
#endif
const char *np = CharNextExA(codepage, p, 0);
if (np - p > 1) // multibyte char
{
int l = np - p;