fix: now compiles and works for simple commands + clang format
This commit is contained in:
parent
6099bbb9e3
commit
352c122549
23 changed files with 168 additions and 150 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#include "utils/ast/ast_redir.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
bool ast_is_redir(struct ast *node)
|
||||
|
|
@ -13,13 +14,16 @@ struct ast_redir *ast_get_redir(struct ast *node)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
struct ast *ast_create_redir(struct ast *child, char *filename, int io_number, enum ast_redir_type type)
|
||||
struct ast *ast_create_redir(struct ast *child, 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.
|
||||
redir->filename =
|
||||
filename; // Takes ownership? Usually yes in simple ASTs, or dup. Let's
|
||||
// assume pointer copy for now, but user must manage memory.
|
||||
redir->io_number = io_number;
|
||||
redir->type = type;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue