summaryrefslogtreecommitdiffstats
path: root/src/parse/ast.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-03-08 02:37:38 -0500
committerJesse Luehrs <doy@tozt.net>2022-03-08 02:37:38 -0500
commit1abb97cca69e0b513f7499cc7db03ba622b38711 (patch)
tree6e59e0e7e4bfe9b00c735feb40c2286b3e0955c7 /src/parse/ast.rs
parentd66f4773bccaee61c1c998640dcdb048223f8900 (diff)
downloadnbsh-1abb97cca69e0b513f7499cc7db03ba622b38711.tar.gz
nbsh-1abb97cca69e0b513f7499cc7db03ba622b38711.zip
use /proc/self/exe directly when re-execing ourself when possible
this will use the same binary that is currently running, even if it has been deleted or replaced
Diffstat (limited to 'src/parse/ast.rs')
-rw-r--r--src/parse/ast.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parse/ast.rs b/src/parse/ast.rs
index 92c04ab..5bceed5 100644
--- a/src/parse/ast.rs
+++ b/src/parse/ast.rs
@@ -171,7 +171,7 @@ impl Exe {
return Self {
exe: Word {
parts: vec![WordPart::SingleQuoted(
- std::env::current_exe()
+ crate::info::current_exe()
.unwrap()
.to_str()
.unwrap()
@@ -370,7 +370,7 @@ impl WordPart {
Self::Alternation(_) => unreachable!(),
Self::Substitution(commands) => {
let mut cmd = tokio::process::Command::new(
- std::env::current_exe().unwrap(),
+ crate::info::current_exe().unwrap(),
);
cmd.args(&["-c", &commands]);
cmd.stdin(std::process::Stdio::inherit());