diff options
Diffstat (limited to 'awkgram.c')
-rw-r--r-- | awkgram.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -6508,7 +6508,7 @@ retry: } } - if (c != '_' && ! is_alpha(c)) { + if (! is_letter(c)) { yyerror(_("invalid char '%c' in expression"), c); return lasttok = LEX_EOF; } @@ -8732,6 +8732,18 @@ is_alnum(int c) } +/* + * is_letter --- function to check letters + * isalpha() isn't good enough since it can look at the locale. + * Underscore counts as a letter in awk identifiers + */ + +bool +is_letter(int c) +{ + return (is_alpha(c) || c == '_'); +} + /* is_identchar --- return true if c can be in an identifier */ bool |