aboutsummaryrefslogtreecommitdiff
path: root/src/lexer/trim.c
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-13 21:01:18 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-13 21:01:18 +0200
commitc51d31b8b751585153500729c25ae2f02d179e45 (patch)
treeeab34e14508f5a2a3ad2c5d06c56afdd7ba72e9e /src/lexer/trim.c
parent490237aece240c05b5a9035665a88327e1be87ed (diff)
downloadminishell-c51d31b8b751585153500729c25ae2f02d179e45.tar.gz
minishell-c51d31b8b751585153500729c25ae2f02d179e45.tar.bz2
minishell-c51d31b8b751585153500729c25ae2f02d179e45.zip
Refactoring eval file structure, Added comment to builtin
Diffstat (limited to 'src/lexer/trim.c')
-rw-r--r--src/lexer/trim.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lexer/trim.c b/src/lexer/trim.c
index b343d69..d6eea5e 100644
--- a/src/lexer/trim.c
+++ b/src/lexer/trim.c
@@ -6,7 +6,7 @@
/* By: nahaddac <nahaddac@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/07/16 08:18:36 by nahaddac #+# #+# */
-/* Updated: 2020/09/13 18:14:59 by charles ### ########.fr */
+/* Updated: 2020/09/13 20:42:05 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -37,6 +37,7 @@ void del_quote(char *str)
i = 0;
if (str[0] == '\'')
+ {
while (str[i++] != '\0')
{
if (str[i] == '\\')
@@ -44,7 +45,9 @@ void del_quote(char *str)
if (str[i] == '\'')
break ;
}
+ }
else if (str[0] == '"')
+ {
while (str[i++] != '\0')
{
if (str[i] == '\\')
@@ -52,6 +55,7 @@ void del_quote(char *str)
if (str[i] == '"')
break ;
}
+ }
str[i] = '\0';
ft_memmove(str, str + 1, ft_strlen(str + 1) + 1);
}