If you remove the line "_putenv("cat=")" from the test, it fails the same way on Windows. This implies that native is detecting when the environment has been modified *back* to its initial state and undoing the reallocation in that case. That strikes me as a little insane; do we care about implementing that behaviour?