mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-03 10:01:21 +00:00
Attempt at fixing ENVIRON for Windows.
'Works on my machine'.
This commit is contained in:
parent
ee4b611056
commit
1fa3781a12
|
@ -21418,10 +21418,19 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
|||
*separator = '\0';
|
||||
if (separator == &buf[str->len] - 1) {
|
||||
//Separator is at end of string, so remove the variable
|
||||
unsetenv(buf);
|
||||
#ifdef QB64_WINDOWS
|
||||
*separator = '=';
|
||||
_putenv(buf);
|
||||
#else
|
||||
unsetenv(buf);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
setenv(buf, separator + 1, 1);
|
||||
#ifdef QB64_WINDOWS
|
||||
_putenv_s(buf, separator + 1);
|
||||
#else
|
||||
setenv(buf, separator + 1, 1);
|
||||
#endif
|
||||
}
|
||||
free(buf);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue