mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-02 18:12:43 +00:00
PlaceholderParser extended with {if}/{elsif}{else} blocks and
+ - * / == != <> numeric expressions.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user