msi: Simplify the code.

This commit is contained in:
Dmitry Timoshkov 2007-06-15 17:43:40 +09:00 committed by Alexandre Julliard
parent 3c444ea350
commit 6076485fde
1 changed files with 7 additions and 17 deletions

View File

@ -4587,30 +4587,20 @@ static LONG env_set_flags( LPCWSTR *name, LPWSTR *value, DWORD *flags )
static const WCHAR prefix[] = {'[','~',']',0}; static const WCHAR prefix[] = {'[','~',']',0};
*flags = 0; *flags = 0;
while (*cptr && (*cptr == '=' || *cptr == '+' || while (*cptr)
*cptr == '-' || *cptr == '!' || *cptr == '*'))
{ {
switch (*cptr) if (*cptr == '=')
{
case '=':
*flags |= ENV_ACT_SETALWAYS; *flags |= ENV_ACT_SETALWAYS;
break; else if (*cptr == '+')
case '+':
*flags |= ENV_ACT_SETABSENT; *flags |= ENV_ACT_SETABSENT;
break; else if (*cptr == '-')
case '-':
*flags |= ENV_ACT_REMOVE; *flags |= ENV_ACT_REMOVE;
break; else if (*cptr == '!')
case '!':
*flags |= ENV_ACT_REMOVEMATCH; *flags |= ENV_ACT_REMOVEMATCH;
break; else if (*cptr == '*')
case '*':
*flags |= ENV_MOD_MACHINE; *flags |= ENV_MOD_MACHINE;
else
break; break;
default:
ERR("Unknown Environment flag: %c\n", *cptr);
return ERROR_FUNCTION_FAILED;
}
cptr++; cptr++;
(*name)++; (*name)++;