From d04b1f10ac2da672383dd05e5d4065d2d7dd8c61 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 1 Aug 2020 19:00:37 +0200 Subject: Opti --- src/p_lcom_next.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/p_lcom_next.c') diff --git a/src/p_lcom_next.c b/src/p_lcom_next.c index f340294..b106032 100644 --- a/src/p_lcom_next.c +++ b/src/p_lcom_next.c @@ -133,11 +133,10 @@ static void } static char - **p_add_to_variables_and_delete( /* t_bool equals[], */ - char *words[], - t_bool reg, - int64_t i, - t_msh *msh) + **p_add_to_variables_and_delete(char *words[], + t_bool reg, + int64_t i, + t_msh *msh) { int64_t j; int64_t k; @@ -184,10 +183,12 @@ char { char *ptr; t_bool reg; + t_bool isvar; int64_t i; i = 0; reg = TRUE; + isvar = TRUE; while (words[i]) { ptr = words[i]; @@ -196,9 +197,13 @@ char if (*ptr == '\0' || words[i][0] == '=') { reg = FALSE; + if (i == 0) + isvar = FALSE; break ; } i++; } - return (p_add_to_variables_and_delete(/* equals, */words, reg, i, msh)); + if (isvar == TRUE) + return (p_add_to_variables_and_delete(words, reg, i, msh)); + return (words); } -- cgit v1.2.3