An environment variable can be in one of three states:
- undefined.
- defined with a non-empty value.
- defined but with an empty value.
The windows implementation did not support case 3 (it was not handling errors). The Linux implementation is already correct.
I believe we usually prefer GetLastError() == ERROR_ENVVAR_NOT_FOUND instead of ERROR_ENVVAR_NOT_FOUND == GetLastError(), just like we did Size == 0 instead of 0 == Size.