Skip to content

Commit

Permalink
fixed err handling for spaces after = in export
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminHThomas committed Jul 30, 2024
1 parent a600a03 commit 6c2ddb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/lexer/lex_bools2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: bthomas <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/20 12:36:56 by bthomas #+# #+# */
/* Updated: 2024/07/29 14:12:46 by bthomas ### ########.fr */
/* Updated: 2024/07/30 11:34:21 by bthomas ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -43,8 +43,7 @@ static bool space_before_last_equals(char *input, size_t idx)
{
while (input[idx] != '=')
idx--;
idx--;
if (is_space(input[idx - 1]))
if (is_space(input[idx - 1]) || is_space(input[idx + 1]))
return (true);
return (false);
}
Expand Down
4 changes: 2 additions & 2 deletions src/lexer/lexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: bthomas <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/28 17:48:06 by bento #+# #+# */
/* Updated: 2024/07/30 11:15:39 by bthomas ### ########.fr */
/* Updated: 2024/07/30 11:33:32 by bthomas ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -74,7 +74,7 @@ static int build_tokenlist1(t_data *data, size_t input_len)
while (i < input_len)
{
if (is_invalid_export(data, i))
return (PANIC);
return (1);
skip_invalid_chars(data, input_len, &i);
if (i >= input_len)
break ;
Expand Down

0 comments on commit 6c2ddb7

Please sign in to comment.