ast: update redirection node to support fd-redirection with sub-expression

This commit is contained in:
2026-05-10 14:19:29 +01:00
parent ba8a2111eb
commit 3398de6fa9
+10 -4
View File
@@ -27,11 +27,17 @@ static void to_string(const struct ast_node *node, fx_bstr *out)
}
if (redirection->n_out_is_fd) {
fx_bstr_write_fmt(out, NULL, " &%u", redirection->n_out);
} else if (redirection->n_out_is_expr) {
fx_bstr_write_fmt(out, NULL, " <expr>");
fx_bstr_write_fmt(out, NULL, " &");
} else {
fx_bstr_write_fmt(out, NULL, " '%s'", redirection->n_out_path);
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);
} else {
fx_bstr_write_fmt(out, NULL, "%u", redirection->n_out);
}
}