From 145adc9d4bc338657ce6f609dcac67682eb329e3 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 17 Sep 2016 00:39:40 +0300 Subject: Audit all print_process()/process ctor for path_search() --- build2/install/rule.cxx | 66 ++++++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 28 deletions(-) (limited to 'build2/install') diff --git a/build2/install/rule.cxx b/build2/install/rule.cxx index 038b53c..fd88699 100644 --- a/build2/install/rule.cxx +++ b/build2/install/rule.cxx @@ -437,14 +437,16 @@ namespace build2 args.push_back (reld.string ().c_str ()); args.push_back (nullptr); - if (verb >= 2) - print_process (args); - else if (verb && verbose) - text << "install " << d; - try { - process pr (args.data ()); + process_path pp (process::path_search (args[0])); + + if (verb >= 2) + print_process (args); + else if (verb && verbose) + text << "install " << d; + + process pr (pp, args.data ()); if (!pr.wait ()) throw failed (); @@ -498,14 +500,16 @@ namespace build2 args.push_back (reld.string ().c_str ()); args.push_back (nullptr); - if (verb >= 2) - print_process (args); - else if (verb && verbose) - text << "install " << t; - try { - process pr (args.data ()); + process_path pp (process::path_search (args[0])); + + if (verb >= 2) + print_process (args); + else if (verb && verbose) + text << "install " << t; + + process pr (pp, args.data ()); if (!pr.wait ()) throw failed (); @@ -545,14 +549,16 @@ namespace build2 const char** args (&args_a[base.sudo == nullptr ? 1 : 0]); - if (verb >= 2) - print_process (args); - else if (verb && verbose) - text << "install " << rell << " -> " << target; - try { - process pr (args); + process_path pp (process::path_search (args[0])); + + if (verb >= 2) + print_process (args); + else if (verb && verbose) + text << "install " << rell << " -> " << target; + + process pr (pp, args); if (!pr.wait ()) throw failed (); @@ -699,14 +705,16 @@ namespace build2 const char** args (&args_a[base.sudo == nullptr ? 1 : 0]); - if (verb >= 2) - print_process (args); - else if (verb && verbose) - text << "uninstall " << reld; - try { - process pr (args); + process_path pp (process::path_search (args[0])); + + if (verb >= 2) + print_process (args); + else if (verb && verbose) + text << "uninstall " << reld; + + process pr (pp, args); if (!pr.wait ()) throw failed (); @@ -798,12 +806,14 @@ namespace build2 const char** args (&args_a[base.sudo == nullptr ? 1 : 0]); - if (verb >= 2) - print_process (args); - try { - process pr (args); + process_path pp (process::path_search (args[0])); + + if (verb >= 2) + print_process (args); + + process pr (pp, args); if (!pr.wait ()) throw failed (); -- cgit v1.1