summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2021-11-15 19:13:43 +0000
committerLars Wirzenius <liw@liw.fi>2021-11-16 11:06:38 +0200
commitfcd38ea7b29e68ca77595004042d0bb743b85cfa (patch)
treebc3b8287eb7197b31379fb495c66cca4c7d60b0d
parent00e5df7d31bf9fa0827dc1fe9ee1f7ee61b2b997 (diff)
downloadsubplot-fcd38ea7b29e68ca77595004042d0bb743b85cfa.tar.gz
subplotlib: Ensure that PATH changes are indeed prepended not appended.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
-rw-r--r--subplotlib/src/steplibrary/runcmd.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/subplotlib/src/steplibrary/runcmd.rs b/subplotlib/src/steplibrary/runcmd.rs
index 2bf8c56..f42df6e 100644
--- a/subplotlib/src/steplibrary/runcmd.rs
+++ b/subplotlib/src/steplibrary/runcmd.rs
@@ -150,8 +150,14 @@ pub fn try_to_run_in(context: &ScenarioContext, dirname: &str, argv0: &str, args
let path = context.with(
|runcmd: &Runcmd| {
Ok(env::join_paths(
- env::split_paths(curpath.as_deref().unwrap_or_else(|| OsStr::new("")))
- .chain(runcmd.paths.iter().rev().map(PathBuf::from)),
+ runcmd
+ .paths
+ .iter()
+ .rev()
+ .map(PathBuf::from)
+ .chain(env::split_paths(
+ curpath.as_deref().unwrap_or_else(|| OsStr::new("")),
+ )),
)?)
},
false,