aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.y
diff options
context:
space:
mode:
Diffstat (limited to 'awkgram.y')
-rw-r--r--awkgram.y14
1 files changed, 13 insertions, 1 deletions
diff --git a/awkgram.y b/awkgram.y
index d06faf8d..ddcc9d72 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -4086,7 +4086,7 @@ retry:
}
}
- if (c != '_' && ! is_alpha(c)) {
+ if (! is_letter(c)) {
yyerror(_("invalid char '%c' in expression"), c);
return lasttok = LEX_EOF;
}
@@ -6308,6 +6308,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