can't figure out why it returns wrong value

This commit is contained in:
mdev9
2024-03-24 10:00:09 +01:00
parent bedf72b553
commit a58366f827
8 changed files with 28 additions and 194 deletions

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/09 15:26:01 by tomoron #+# #+# */
/* Updated: 2024/03/23 19:23:50 by marde-vr ### ########.fr */
/* Updated: 2024/03/24 08:50:11 by marde-vr ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
@ -54,7 +54,7 @@ char *get_token(char **cmd, int *in_quote, int *in_dquote, t_env *env)
else if (**cmd == '~' && !*in_quote && !*in_dquote)
i += add_home_to_str(res + i);
else if (((**cmd == '\'' && *in_dquote) || (**cmd == '"' && *in_quote))
|| (**cmd != '\'' && **cmd != '"'))
|| (**cmd != '\'' && **cmd != '"'))
res[i++] = **cmd;
(*cmd)++;
}