aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbutl/process-run.txx5
-rw-r--r--libbutl/process.mxx14
2 files changed, 15 insertions, 4 deletions
diff --git a/libbutl/process-run.txx b/libbutl/process-run.txx
index f6c14f5..85e51e2 100644
--- a/libbutl/process-run.txx
+++ b/libbutl/process-run.txx
@@ -5,9 +5,8 @@
LIBBUTL_MODEXPORT namespace butl //@@ MOD Clang needs this for some reason.
{
template <typename V>
- process_env::
- process_env (const process_path& p, const V& v)
- : process_env (p)
+ void process_env::
+ init_vars (const V& v)
{
if (!v.empty ())
{
diff --git a/libbutl/process.mxx b/libbutl/process.mxx
index a536fe9..8f8b930 100644
--- a/libbutl/process.mxx
+++ b/libbutl/process.mxx
@@ -536,7 +536,8 @@ LIBBUTL_MODEXPORT namespace butl
: process_env (p, v) {cwd = &c;}
template <typename V>
- process_env (const process_path& p, const V& v);
+ process_env (const process_path& p, const V& v)
+ : process_env (p) {init_vars (v);}
process_env (const char* p,
const dir_path& c = dir_path (),
@@ -578,6 +579,17 @@ LIBBUTL_MODEXPORT namespace butl
: process_env (p.string (), v) {}
private:
+ template <typename V>
+ void
+ init_vars (const V&);
+
+ template <std::size_t N>
+ void
+ init_vars (const char* const (&v)[N])
+ {
+ vars = v;
+ }
+
process_path path_;
small_vector<const char*, 3> vars_;
};