aboutsummaryrefslogtreecommitdiff
path: root/butl
diff options
context:
space:
mode:
Diffstat (limited to 'butl')
-rw-r--r--butl/process.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/butl/process.cxx b/butl/process.cxx
index 75e8718..80b97cc 100644
--- a/butl/process.cxx
+++ b/butl/process.cxx
@@ -486,10 +486,21 @@ namespace butl
// Do PATH search.
//
if (file.simple ())
+ {
file = path_search (file);
- if (file.empty ())
- fail ("file not found");
+ if (file.empty ())
+ fail ("file not found");
+ }
+ else
+ {
+ // Unless there is already the .exe extension, add it. See path_search()
+ // for details.
+ //
+ const char* e (file.extension ());
+ if (e == nullptr || casecmp (e, "exe") != 0)
+ file += ".exe";
+ }
// Serialize the arguments to string.
//