mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 13:01:21 -03:00
fish.rs: fix regression in fish_xdm_login_hack_hack_hack_hack
This is off by one from the C++ version.
It wasn't super obvious why this worked in the first place.
Looks like args[0] is "-" because we are invoked like
fish -c 'exec "${@}"' - "${@}"
and it looks like "-" is treated like "--" by bash, so we emulate that.
See https://github.com/fish-shell/fish-shell/issues/367#issuecomment-11740812
This commit is contained in:
@@ -856,7 +856,7 @@ fn fish_xdm_login_hack_hack_hack_hack(cmds: &mut Vec<OsString>, args: &[&wstr])
|
||||
// We're going to construct a new command that starts with exec, and then has the
|
||||
// remaining arguments escaped.
|
||||
let mut new_cmd = OsString::from("exec");
|
||||
for arg in args {
|
||||
for arg in &args[1..] {
|
||||
new_cmd.push(" ");
|
||||
new_cmd.push(escape_single_quoted_hack_hack_hack_hack(arg));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user