aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-04-14 11:03:52 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-04-14 11:03:52 +0200
commit62406eb17325a764b715a69f90484546a87f3386 (patch)
treea5c383fb4ab19ee01da7e7c71191a40052cc273d
parent2e14b5bb79a27427722a37ccf5f4fa154f4fbd92 (diff)
Improve process_path::empty()
-rw-r--r--libbutl/process.mxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/libbutl/process.mxx b/libbutl/process.mxx
index a03e40f..c52869e 100644
--- a/libbutl/process.mxx
+++ b/libbutl/process.mxx
@@ -103,8 +103,8 @@ LIBBUTL_MODEXPORT namespace butl
//
// Note that the call to path_search() below adjust args[0] to point to the
// recall path which brings up lifetime issues. To address this this class
- // also implements an RAII-based auto-restore of args[0] to its initial
- // value.
+ // also implements an optional RAII-based auto-restore of args[0] to its
+ // initial value.
//
class process_path
{
@@ -118,9 +118,11 @@ LIBBUTL_MODEXPORT namespace butl
const char* recall_string () const;
const char* effect_string () const;
- bool empty () const
+ bool
+ empty () const
{
- return initial == nullptr && recall.empty () && effect.empty ();
+ return (initial == nullptr || *initial == '\0') &&
+ recall.empty () && effect.empty ();
}
// Clear recall making it the same as effective.