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:
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user