subsh bool
This commit is contained in:
@@ -62,17 +62,13 @@ t_dio_node get_cmd_txt(t_ast_n *node)
|
||||
// txt.redir = translate_redir(node->redir);
|
||||
// txt.inf = ft_sprintf("Infile : %s%s", node->infile, NL);
|
||||
// txt.outf = ft_sprintf("Outfile : %s", node->outfile);
|
||||
txt.redir = "";
|
||||
txt.inf = ft_sprintf("Infile : UNCHECKED");
|
||||
txt.outf = ft_sprintf("Outfile : UNCHECKED");
|
||||
txt.files = ft_sprintf("redir: UNCHECKED\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
txt.cmd = ft_calloc(1, 1);
|
||||
txt.args = ft_calloc(1, 1);
|
||||
txt.redir = "";
|
||||
txt.inf = ft_calloc(1, 1);
|
||||
txt.outf = ft_calloc(1, 1);
|
||||
txt.files = ft_calloc(1, 1);
|
||||
}
|
||||
return (txt);
|
||||
}
|
||||
|
||||
@@ -15,15 +15,19 @@
|
||||
char *get_node_txt(t_ast_n *node)
|
||||
{
|
||||
t_dio_node txt;
|
||||
char *out;
|
||||
static char *subsh;
|
||||
char *out;
|
||||
|
||||
txt = get_cmd_txt(node);
|
||||
out = ft_sprintf("%s%s%s%s%s%s%s", txt.st, txt.cmd, txt.args,
|
||||
NL, txt.redir, txt.inf, txt.outf);
|
||||
if (node->sh == true)
|
||||
subsh = " (subsh) ";
|
||||
else
|
||||
subsh = "";
|
||||
out = ft_sprintf("%s%s%s%s%s", txt.st, txt.cmd, txt.args,
|
||||
subsh, txt.files);
|
||||
free(txt.cmd);
|
||||
free(txt.args);
|
||||
free(txt.inf);
|
||||
free(txt.outf);
|
||||
free(txt.files);
|
||||
return (out);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user