id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 7018,operations_test.cpp does not correctly use setenv,Daniel Krügler ,Beman Dawes,"The constructor of guarded_env_var::previous_value never sets the member variable m_name but does instead set the member m_string with the environment name. This means that the destructor of previous_value always calls unsetenv or setenv with an empty name string. The required fix seems to be to replace in line 1711 {{{ : m_string(name) }}} by {{{ : m_name(name) }}} As I side note I would like to remark that the return values of the Windows emulations between line 62 and 75 {{{ inline int setenv(const char* name, const fs::path::value_type* val, int) { return SetEnvironmentVariableW(convert(name).c_str(), val); } inline int setenv(const char* name, const char* val, int) { return SetEnvironmentVariableW(convert(name).c_str(), convert(val).c_str()); } inline int unsetenv(const char* name) { return SetEnvironmentVariableW(convert(name).c_str(), 0); } }}} are inverted versus the POSIX functions, ::SetEnvironmentVariableW returns 0 on failure and non-zero on success. While a proper fix is easy to realize along the lines of {{{ inline int setenv(const char* name, const fs::path::value_type* val, int) { return SetEnvironmentVariableW(convert(name).c_str(), val) ? 0 : -1; } inline int setenv(const char* name, const char* val, int) { return SetEnvironmentVariableW(convert(name).c_str(), convert(val).c_str()) ? 0 : -1; } inline int unsetenv(const char* name) { return SetEnvironmentVariableW(convert(name).c_str(), 0) ? 0 : -1; } }}} a much simpler fix would be to define them as void functions because the return values are never tested. ",Bugs,closed,To Be Determined,filesystem,Boost 1.49.0,Problem,fixed,,