diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2016-09-16 16:44:50 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2016-09-17 23:54:24 +0300 |
commit | fdd72db7512ecd2410e9ddcb144abea23d67b2c7 (patch) | |
tree | 692307fdc473a7bb52267d46b44ebb835800e73f /bpkg/fetch.cxx | |
parent | e0efe0475bed89b6d60a04ce63dbc061e553bd59 (diff) |
Audit all print_process()/process ctor for path_search()
Diffstat (limited to 'bpkg/fetch.cxx')
-rw-r--r-- | bpkg/fetch.cxx | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/bpkg/fetch.cxx b/bpkg/fetch.cxx index 33753fb..0851950 100644 --- a/bpkg/fetch.cxx +++ b/bpkg/fetch.cxx @@ -36,12 +36,14 @@ namespace bpkg // const char* args[] = {prog.string ().c_str (), "--version", nullptr}; - if (verb >= 3) - print_process (args); - try { - process pr (args, 0, -1); // Redirect STDOUT to a pipe. + process_path pp (process::path_search (args[0])); + + if (verb >= 3) + print_process (args); + + process pr (pp, args, 0, -1); // Redirect STDOUT to a pipe. string l; @@ -155,6 +157,8 @@ namespace bpkg args.push_back (url.c_str ()); args.push_back (nullptr); + process_path pp (process::path_search (args[0])); + if (verb >= 2) print_process (args); @@ -164,8 +168,8 @@ namespace bpkg // report. Process exceptions must be handled by the caller. // return fo - ? process (out.directory ().string ().c_str (), args.data ()) - : process (args.data (), 0, -1); + ? process (out.directory ().string ().c_str (), pp, args.data ()) + : process (pp, args.data (), 0, -1); } // curl @@ -178,12 +182,14 @@ namespace bpkg // const char* args[] = {prog.string ().c_str (), "--version", nullptr}; - if (verb >= 3) - print_process (args); - try { - process pr (args, 0, -1); // Redirect STDOUT to a pipe. + process_path pp (process::path_search (args[0])); + + if (verb >= 3) + print_process (args); + + process pr (pp, args, 0, -1); // Redirect STDOUT to a pipe. try { @@ -260,6 +266,8 @@ namespace bpkg args.push_back (url.c_str ()); args.push_back (nullptr); + process_path pp (process::path_search (args[0])); + if (verb >= 2) print_process (args); else if (verb == 1 && fo) @@ -273,8 +281,8 @@ namespace bpkg // Process exceptions must be handled by the caller. // return fo - ? process (args.data ()) - : process (args.data (), 0, -1); + ? process (pp, args.data ()) + : process (pp, args.data (), 0, -1); } // fetch @@ -289,12 +297,14 @@ namespace bpkg // const char* args[] = {prog.string ().c_str (), nullptr}; - if (verb >= 3) - print_process (args); - try { - process pr (args, 0, -1, 1); // Redirect STDOUT and STDERR to a pipe. + process_path pp (process::path_search (args[0])); + + if (verb >= 3) + print_process (args); + + process pr (pp, args, 0, -1, 1); // Redirect STDOUT and STDERR to a pipe. try { @@ -363,6 +373,8 @@ namespace bpkg args.push_back (url.c_str ()); args.push_back (nullptr); + process_path pp (process::path_search (args[0])); + if (verb >= 2) print_process (args); @@ -372,8 +384,8 @@ namespace bpkg // report. Process exceptions must be handled by the caller. // return fo - ? process (out.directory ().string ().c_str (), args.data ()) - : process (args.data (), 0, -1); + ? process (out.directory ().string ().c_str (), pp, args.data ()) + : process (pp, args.data (), 0, -1); } // The dispatcher. |