Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to unset environment variable on linux #229

Closed
tobil4sk opened this issue Aug 26, 2021 · 0 comments · Fixed by #233
Closed

Unable to unset environment variable on linux #229

tobil4sk opened this issue Aug 26, 2021 · 0 comments · Fixed by #233

Comments

@tobil4sk
Copy link
Member

tobil4sk commented Aug 26, 2021

There is an issue where I cannot unset an environment variable when targetting neko with Haxe.

If I check the value of a variable that does not exist yet, it returns null:

Sys.getEnv("VARIABLE"); //null

Afterwards, if I set it, then I am unable to unset it. Setting it to an empty string means that getting the value of the variable will now be the empty string instead of null, whereas on Windows it deletes the variable.

Sys.putEnv("VARIABLE", "value"); // setting it
Sys.putEnv("VARIABLE", ""); // attempting to unset

Sys.getEnv("VARIABLE"); // returns ""

If I run this code on the eval target then it works properly, after setting to an empty string, Sys.getEnv returns null again. I was wrong.

tobil4sk added a commit to tobil4sk/neko that referenced this issue Aug 26, 2021
* When `put_env` is called with an empty string for `v`, it now unsets
the variable on all platforms, not just windows
@Simn Simn closed this as completed in #233 Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant