1
0
mirror of https://github.com/KeyZox71/ft_minipowershell.git synced 2025-05-13 16:08:45 +02:00

🔨」 fix: fixed quote unclosed

This commit is contained in:
2024-07-16 16:20:23 +02:00
parent bf60c02fd3
commit e0987139dd
6 changed files with 53 additions and 34 deletions

View File

@ -6,7 +6,7 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/03 10:50:52 by mmoussou #+# #+# */
/* Updated: 2024/07/15 18:36:05 by adjoly ### ########.fr */
/* Updated: 2024/07/16 16:17:45 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -17,6 +17,8 @@ size_t __get_size_in_quote(char *cmd)
char *tmp;
tmp = search_for_next_quote(cmd + 1, __is_quote(*cmd));
if (!tmp)
return (0);
return (tmp - cmd);
}
@ -45,6 +47,8 @@ char *format_quotes_string(char *cmd)
if (*tmp == DOUBLE || *tmp == SINGLE)
{
inquote = __get_size_in_quote(tmp);
if (inquote == 0)
return (NULL);
ft_strlcat(ret, tmp + 1, ft_strlen(ret) + inquote);
tmp += inquote;
}

View File

@ -6,7 +6,7 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/09 22:53:01 by adjoly #+# #+# */
/* Updated: 2024/07/16 14:39:09 by adjoly ### ########.fr */
/* Updated: 2024/07/16 15:49:01 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -36,4 +36,3 @@ int send_error_exec(char *input)
free(input);
return (-1);
}