Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unseparted when a expand var start with a with space #50

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading