postprocessing: do quote removal

This commit is contained in:
Khaïs COLIN 2025-03-20 17:34:07 +01:00
parent 22b0b4746f
commit f07a80c762
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
5 changed files with 141 additions and 3 deletions

View file

@ -6,7 +6,7 @@
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/06 13:44:06 by kcolin #+# #+# */
/* Updated: 2025/03/19 16:38:42 by khais ### ########.fr */
/* Updated: 2025/03/20 17:36:58 by khais ### ########.fr */
/* */
/* ************************************************************************** */
@ -16,6 +16,7 @@
#include "parser/wordlist/wordlist.h"
#include "parser/wordsplit/wordsplit.h"
#include "postprocess/redirections/redirection_parsing.h"
#include "parser/remove_quotes/remove_quotes.h"
#include <stdlib.h>
/*
@ -53,11 +54,14 @@ static void debug_command(t_cmdgroup *cmd)
**
** Currently, this is the following:
** 1. redirection parsing
** 2. quote removal
*/
static t_cmdgroup *post_process_command(t_cmdgroup *cmd)
{
if (cmdgroup_parse_redirections(cmd) == NULL)
return (cmdgroup_destroy(cmd), NULL);
if (cmdgroup_remove_quotes(cmd) == NULL)
return (cmdgroup_destroy(cmd), NULL);
return (cmd);
}