fix readline vi-mode mark commands to prevent errors if user types an arrow key where a mark name is expected; fix for non-ascii characters being included in variable names if the system isalnum(3) returns success for the character

This commit is contained in:
Chet Ramey
2026-08-07 11:46:08 -04:00
parent 9b6349ef40
commit 9c8a70bc9e
24 changed files with 18698 additions and 19440 deletions
+7 -2
View File
@@ -110,8 +110,13 @@ extern char *strcpy (char *, const char *);
#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
/* Define exactly what a legal shell identifier consists of. */
#define legal_variable_starter(c) (ISALPHA(c) || (c == '_'))
#define legal_variable_char(c) (ISALNUM(c) || c == '_')
#if 0
#define legal_variable_starter(c) (c < 128 && (ISALPHA(c) || c == '_'))
#define legal_variable_char(c) (c < 128 && (ISALNUM(c) || c == '_'))
#else
#define legal_variable_starter(c) (sh_syntaxtab[c] & CNAMESTART)
#define legal_variable_char(c) (sh_syntaxtab[c] & CNAME)
#endif
/* Definitions used in subst.c and by the `read' builtin for field
splitting. */