diff options
Diffstat (limited to 'bpkg/database.cxx')
-rw-r--r-- | bpkg/database.cxx | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/bpkg/database.cxx b/bpkg/database.cxx index f5102f0..3c55237 100644 --- a/bpkg/database.cxx +++ b/bpkg/database.cxx @@ -4,8 +4,6 @@ #include <bpkg/database.hxx> -#include <stdlib.h> // getenv() setenv()/_putenv() - #include <odb/schema-catalog.hxx> #include <odb/sqlite/exceptions.hxx> @@ -25,7 +23,7 @@ namespace bpkg // BPKG_OPEN_CONFIG environment variable. A bit heavy-weight but seems like // the best option. // - static const char open_name[] = "BPKG_OPEN_CONFIG"; + static const string open_name ("BPKG_OPEN_CONFIG"); class conn_factory: public single_connection_factory // No need for pool. { @@ -36,21 +34,13 @@ namespace bpkg v.complete (); v.normalize (); -#ifndef _WIN32 - setenv (open_name, v.string ().c_str (), 1 /* overwrite */); -#else - _putenv ((string (open_name) + '=' + v.string ()).c_str ()); -#endif + setenv (open_name, v.string ()); } virtual ~conn_factory () { -#ifndef _WIN32 unsetenv (open_name); -#else - _putenv ((string (open_name) + '=').c_str ()); -#endif } }; |