feat(parser): redirections
This commit is contained in:
parent
04ff7376eb
commit
8a5c589742
17 changed files with 78 additions and 108 deletions
|
|
@ -14,13 +14,12 @@ struct ast_redir *ast_get_redir(struct ast *node)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
struct ast *ast_create_redir(struct ast *child, char *filename, int io_number,
|
||||
struct ast *ast_create_redir(char *filename, int io_number,
|
||||
enum ast_redir_type type)
|
||||
{
|
||||
struct ast_redir *redir = malloc(sizeof(struct ast_redir));
|
||||
if (!redir)
|
||||
return NULL;
|
||||
redir->child = child;
|
||||
redir->filename =
|
||||
filename; // Takes ownership? Usually yes in simple ASTs, or dup. Let's
|
||||
// assume pointer copy for now, but user must manage memory.
|
||||
|
|
@ -34,7 +33,6 @@ void ast_free_redir(struct ast_redir *redir)
|
|||
{
|
||||
if (!redir)
|
||||
return;
|
||||
ast_free(&redir->child);
|
||||
free(redir->filename);
|
||||
free(redir);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue