Simplified searching for escape charaters in strings when uservars enabled

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2753 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
ramon18 2003-07-19 12:06:43 +00:00
parent 6395ec3c8c
commit 1473e80f12
2 changed files with 2 additions and 19 deletions

View file

@ -470,15 +470,9 @@ int CEXEBuild::preprocess_string(char *out, const char *in)
while (l--)
{
int i = (unsigned char)*p++;
#ifndef NSIS_SUPPORT_NAMED_USERVARS
if (i >= VAR_CODES_START) {
*out++ = (char)255;
}
#else
if (i == VAR_CODES_START || i == 255 ) {
*out++ = (char)255;
}
#endif
*out++=i;
}
continue;
@ -488,21 +482,10 @@ int CEXEBuild::preprocess_string(char *out, const char *in)
p=np;
#ifndef NSIS_SUPPORT_NAMED_USERVARS
// Test for characters extending into the variable codes
if (i >= VAR_CODES_START) {
*out++ = (char)255;
}
#else
// Test for characters that equals to control char of variable codes or lang strings
if (i == VAR_CODES_START ||
#ifdef NSIS_SUPPORT_LANG_IN_STRINGS
i == LANG_CODES_START ||
#endif
i == 255 ) {
*out++ = (char)255;
}
#endif
else if (i == '$')
{
if (*p == '$')

View file

@ -517,7 +517,7 @@ DWORD NSISCALL SetSelfFilePointer(LONG lDistanceToMove, DWORD dwMoveMethod);
// $0..$9, $INSTDIR, etc are encoded as ASCII bytes starting from this value.
// Added by ramon 3 jun 2003
#ifdef NSIS_SUPPORT_NAMED_USERVARS
#define VAR_CODES_START 250
#define VAR_CODES_START 253
#else
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
#define VAR_CODES_START (256 - 37)
@ -527,7 +527,7 @@ DWORD NSISCALL SetSelfFilePointer(LONG lDistanceToMove, DWORD dwMoveMethod);
#endif
#ifdef NSIS_SUPPORT_LANG_IN_STRINGS
#define LANG_CODES_START 251
#define LANG_CODES_START 254
#endif
union installer_flags {