Skip to content

Commit

Permalink
Remove unseparted when a expand var start with a with space
Browse files Browse the repository at this point in the history
  • Loading branch information
UnRenardQuiDab committed Apr 10, 2024
1 parent bbdd27d commit db7b2cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions srcs/expander/expander_split.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: bwisniew <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/02 16:17:47 by bwisniew #+# #+# */
/* Updated: 2024/04/03 18:26:17 by bwisniew ### ########.fr */
/* Updated: 2024/04/10 22:36:46 by bwisniew ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -66,8 +66,10 @@ size_t expander_split(t_mshell *sh, size_t token_i)
size_t i;
char **split;

token = &((t_token *)(sh->tokens.tab))[token_i];
token = &((t_token *)sh->tokens.tab)[token_i];
replace_white_space(token->txt);
if (token->txt && ft_isspace(token->txt[0]) && token_i > 0)
((t_token *)sh->tokens.tab)[token_i - 1].is_separated = true;
split = ft_split(token->txt, ' ');
if (!split)
return (-1);
Expand Down

0 comments on commit db7b2cc

Please sign in to comment.