diff options
Diffstat (limited to 'libbutl/process.mxx')
-rw-r--r-- | libbutl/process.mxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libbutl/process.mxx b/libbutl/process.mxx index 1f378c4..b8c6054 100644 --- a/libbutl/process.mxx +++ b/libbutl/process.mxx @@ -494,7 +494,6 @@ LIBBUTL_MODEXPORT namespace butl quote_argument (const char*, std::string& buffer); #endif - public: id_type id () const; @@ -548,6 +547,16 @@ LIBBUTL_MODEXPORT namespace butl const dir_path* cwd = nullptr; const char* const* vars = nullptr; + // Return true if there is an "environment", that is, either the current + // working directory or environment variables. + // + bool + env () const + { + return (cwd != nullptr && !cwd->empty ()) || + (vars != nullptr && *vars != nullptr); + } + process_env (const process_path& p, const dir_path& c = dir_path (), const char* const* v = nullptr) |