mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-08 23:05:14 +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';
|
*separator = '\0';
|
||||||
if (separator == &buf[str->len] - 1) {
|
if (separator == &buf[str->len] - 1) {
|
||||||
//Separator is at end of string, so remove the variable
|
//Separator is at end of string, so remove the variable
|
||||||
|
#ifdef QB64_WINDOWS
|
||||||
|
*separator = '=';
|
||||||
|
_putenv(buf);
|
||||||
|
#else
|
||||||
unsetenv(buf);
|
unsetenv(buf);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
#ifdef QB64_WINDOWS
|
||||||
|
_putenv_s(buf, separator + 1);
|
||||||
|
#else
|
||||||
setenv(buf, separator + 1, 1);
|
setenv(buf, separator + 1, 1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
free(buf);
|
free(buf);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue