Skip to content

Commit

Permalink
Fix empty op printing, re issue #591
Browse files Browse the repository at this point in the history
  • Loading branch information
infradig committed Sep 15, 2024
1 parent e830aae commit ad9956c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ static bool op_needs_quoting(module *m, const char *src, int srclen)
if (!strcmp(src, "{}") || !strcmp(src, "[]") || !strcmp(src, "!"))
return false;

if (!srclen)
return true;

int ch = peek_char_utf8(src);

if (iswupper(ch) || iswdigit(ch) || (ch == '_'))
Expand Down

0 comments on commit ad9956c

Please sign in to comment.