aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-05-30 20:03:45 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-05-30 20:03:45 +0300
commitc0a025542988b63275fe1f9281020f4d4bec58a6 (patch)
tree403a5cdfa9a2299fb2edfe69c86d7e9c1ded8838
parent4e58f653ab2a445998ed51eb73db0b1de228a49b (diff)
Fix process_path() constructor
-rw-r--r--libbutl/process.ixx8
-rw-r--r--libbutl/process.mxx3
2 files changed, 9 insertions, 2 deletions
diff --git a/libbutl/process.ixx b/libbutl/process.ixx
index 07c8bac..eba6be5 100644
--- a/libbutl/process.ixx
+++ b/libbutl/process.ixx
@@ -12,12 +12,16 @@ namespace butl
*args0_ = initial;
}
+ // Note that moving the argument into recall and leaving effective empty
+ // complies with the constructor semantics and also makes sure that the
+ // move/copy constructors and assignment operators work correctly.
+ //
inline process_path::
process_path (path e)
- : effect (std::move (e)),
+ : recall (std::move (e)),
args0_ (nullptr)
{
- initial = effect.string ().c_str ();
+ initial = recall.string ().c_str ();
}
inline process_path::
diff --git a/libbutl/process.mxx b/libbutl/process.mxx
index c52869e..fa97ebf 100644
--- a/libbutl/process.mxx
+++ b/libbutl/process.mxx
@@ -130,8 +130,11 @@ LIBBUTL_MODEXPORT namespace butl
void
clear_recall ();
+ // Make all three paths the same.
+ //
explicit
process_path (path effect);
+
process_path (const char* initial, path&& recall, path&& effect);
process_path () = default;