ast: update redirection node to support fd-redirection with sub-expression
This commit is contained in:
@@ -27,11 +27,17 @@ static void to_string(const struct ast_node *node, fx_bstr *out)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (redirection->n_out_is_fd) {
|
if (redirection->n_out_is_fd) {
|
||||||
fx_bstr_write_fmt(out, NULL, " &%u", redirection->n_out);
|
fx_bstr_write_fmt(out, NULL, " &");
|
||||||
} else if (redirection->n_out_is_expr) {
|
|
||||||
fx_bstr_write_fmt(out, NULL, " <expr>");
|
|
||||||
} else {
|
} else {
|
||||||
|
fx_bstr_write_fmt(out, NULL, " ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (redirection->n_out_is_expr) {
|
||||||
|
fx_bstr_write_fmt(out, NULL, "<expr>");
|
||||||
|
} else if (redirection->n_out_path) {
|
||||||
fx_bstr_write_fmt(out, NULL, "'%s'", redirection->n_out_path);
|
fx_bstr_write_fmt(out, NULL, "'%s'", redirection->n_out_path);
|
||||||
|
} else {
|
||||||
|
fx_bstr_write_fmt(out, NULL, "%u", redirection->n_out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user