fix(expansion/wildcard): do not remove quotes twice on non-pattern strings

There is still an issue with removing too many quotes when expanding variables
(see #138). This will be tackled in a later PR.
This commit is contained in:
Khaïs COLIN 2025-04-22 12:45:28 +02:00
parent aca85c3583
commit 2180909285
4 changed files with 19 additions and 5 deletions

View file

@ -6,7 +6,7 @@
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/27 16:21:56 by khais #+# #+# */
/* Updated: 2025/04/21 08:45:05 by khais ### ########.fr */
/* Updated: 2025/04/22 13:14:33 by khais ### ########.fr */
/* */
/* ************************************************************************** */
@ -43,13 +43,16 @@ static t_simple_cmd *post_process_command(t_simple_cmd *cmd, t_minishell *app)
simple_cmd_post_process_debug(cmd, app);
if (simple_cmd_expand_vars(cmd, app) == NULL)
return (NULL);
simple_cmd_post_process_debug(cmd, app);
if (simple_cmd_fieldsplit(cmd) == NULL)
{
app->last_return_value = 1;
return (NULL);
}
simple_cmd_post_process_debug(cmd, app);
if (simple_cmd_expand_wildcards(cmd) == NULL)
return (NULL);
simple_cmd_post_process_debug(cmd, app);
if (simple_cmd_remove_quotes(cmd) == NULL)
return (NULL);
return (cmd);