-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_is_quoted.c
27 lines (24 loc) · 1.09 KB
/
ft_is_quoted.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_is_quoted.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abenamar <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/09/02 20:18:38 by abenamar #+# #+# */
/* Updated: 2023/09/13 04:50:07 by abenamar ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
size_t ft_is_quoted(char *str)
{
size_t i;
if (str[0] != '\'' && str[0] != '"')
return (0);
i = 1;
while (str[i] && str[i] != str[0])
++i;
if (str[i] == str[0])
return (i);
return (0);
}