mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 10:43:47 +08:00
builtin read: minor code cleanup
This commit is contained in:
parent
62d1720605
commit
2972407b9e
|
@ -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 New Issue
Block a user