mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
builtin read: minor code cleanup
This commit is contained in:
parent
62d1720605
commit
2972407b9e
1 changed files with 3 additions and 5 deletions
|
@ -677,11 +677,9 @@ pub fn read(parser: &Parser, streams: &mut IoStreams, argv: &mut [&wstr]) -> Opt
|
|||
break;
|
||||
};
|
||||
let text = tok.text_of(&t);
|
||||
if let Some(out) = unescape_string(text, UnescapeStringStyle::default()) {
|
||||
parser.set_var_and_fire(argv[var_ptr], opts.place, vec![out]);
|
||||
} else {
|
||||
parser.set_var_and_fire(argv[var_ptr], opts.place, vec![text.to_owned()]);
|
||||
}
|
||||
let out = unescape_string(text, UnescapeStringStyle::default())
|
||||
.unwrap_or_else(|| text.to_owned());
|
||||
parser.set_var_and_fire(argv[var_ptr], opts.place, vec![out]);
|
||||
var_ptr += 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue