PlaceholderParser extended with {if}/{elsif}{else} blocks and

+ - * / == != <> numeric expressions.
This commit is contained in:
bubnikv 2017-11-26 09:59:14 +01:00
parent 9205c8aab4
commit 708f416c84
4 changed files with 485 additions and 196 deletions

View file

@ -101,18 +101,16 @@ namespace nowide {
{
char const *key = string;
char const *key_end = string;
while(*key_end!='=' && key_end!='\0')
key_end++;
if(*key_end == '\0')
while(*key_end != '=' && *key_end != 0)
++ key_end;
if(*key_end == 0)
return -1;
wshort_stackstring wkey;
if(!wkey.convert(key,key_end))
return -1;
wstackstring wvalue;
if(!wvalue.convert(key_end+1))
return -1;
if(SetEnvironmentVariableW(wkey.c_str(),wvalue.c_str()))
return 0;
return -1;