Skip to content

Fix potential problem getenv in windows.#3

Merged
Float314 merged 3 commits into
Float314:mainfrom
fundeliciousjelly:main
Jul 17, 2026
Merged

Fix potential problem getenv in windows.#3
Float314 merged 3 commits into
Float314:mainfrom
fundeliciousjelly:main

Conversation

@fundeliciousjelly

@fundeliciousjelly fundeliciousjelly commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Hi!
So I read the source code, and I came to notice std::getenv in windows.
getenv in windows (in msvc), doesn't support universal windows platform apps, means getenv cannot be ran in windows runtime.
but it also create lots of mappings based on the windows environment like
{45D2D811-F547-40F4-AAF8-3DFE98D3BEE1}
Hence, the safest approach is to use the GetEnvironmentVariableA, from windows.h, and lives in kernel32.lib, as it support any windows regardless if its universal or not.

@fundeliciousjelly fundeliciousjelly changed the title Fix potential problem in getenv in windows. Fix potential problem getenv in windows. Jul 16, 2026
@Float314

Copy link
Copy Markdown
Owner

Hi there @fundeliciousjelly . I did knew that std::getenv was deprecaed in Win32 (maybe other methods) and thank you for providing me the solution!

@Float314
Float314 merged commit 51af6d6 into Float314:main Jul 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants