mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-31 23:28:45 +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;
|
break;
|
||||||
};
|
};
|
||||||
let text = tok.text_of(&t);
|
let text = tok.text_of(&t);
|
||||||
if let Some(out) = unescape_string(text, UnescapeStringStyle::default()) {
|
let out = unescape_string(text, UnescapeStringStyle::default())
|
||||||
parser.set_var_and_fire(argv[var_ptr], opts.place, vec![out]);
|
.unwrap_or_else(|| text.to_owned());
|
||||||
} else {
|
parser.set_var_and_fire(argv[var_ptr], opts.place, vec![out]);
|
||||||
parser.set_var_and_fire(argv[var_ptr], opts.place, vec![text.to_owned()]);
|
|
||||||
}
|
|
||||||
var_ptr += 1;
|
var_ptr += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue