mirror of
https://github.com/nushell/nushell
synced 2024-12-30 15:03:25 +00:00
Add unescaping to external command parsing (#5399)
This commit is contained in:
parent
98ab31e15e
commit
92785ab92c
1 changed files with 8 additions and 2 deletions
|
@ -264,8 +264,11 @@ pub fn parse_external_call(
|
||||||
error = error.or(err);
|
error = error.or(err);
|
||||||
Box::new(arg)
|
Box::new(arg)
|
||||||
} else {
|
} else {
|
||||||
|
let (contents, err) = unescape_unquote_string(&head_contents, head_span);
|
||||||
|
error = error.or(err);
|
||||||
|
|
||||||
Box::new(Expression {
|
Box::new(Expression {
|
||||||
expr: Expr::String(String::from_utf8_lossy(&head_contents).to_string()),
|
expr: Expr::String(contents),
|
||||||
span: head_span,
|
span: head_span,
|
||||||
ty: Type::String,
|
ty: Type::String,
|
||||||
custom_completion: None,
|
custom_completion: None,
|
||||||
|
@ -285,8 +288,11 @@ pub fn parse_external_call(
|
||||||
error = error.or(err);
|
error = error.or(err);
|
||||||
args.push(arg);
|
args.push(arg);
|
||||||
} else {
|
} else {
|
||||||
|
let (contents, err) = unescape_unquote_string(contents, *span);
|
||||||
|
error = error.or(err);
|
||||||
|
|
||||||
args.push(Expression {
|
args.push(Expression {
|
||||||
expr: Expr::String(String::from_utf8_lossy(contents).to_string()),
|
expr: Expr::String(contents),
|
||||||
span: *span,
|
span: *span,
|
||||||
ty: Type::String,
|
ty: Type::String,
|
||||||
custom_completion: None,
|
custom_completion: None,
|
||||||
|
|
Loading…
Reference in a new issue