history library can now read history from non-regular files; fix for readline char search and macros; better fix for PROMPT_COMMAND and aliases ending in newlines; fix for casting COMMAND * and SIMPLE_COM * when parsing |&; fix to avoid undefined behavior when performing left and right arithmetic shifts

This commit is contained in:
Chet Ramey
2025-08-01 16:26:31 -04:00
parent 01070d4324
commit c1d9c08853
19 changed files with 217 additions and 45 deletions
+5 -9
View File
@@ -145,10 +145,6 @@
lowest precedence. */
#define EXP_LOWEST expcomma
#ifndef MAX_INT_LEN
# define MAX_INT_LEN 32
#endif
struct lvalue
{
char *tokstr; /* possibly-rewritten lvalue if not NULL */
@@ -581,10 +577,10 @@ expassign (void)
lvalue -= value;
break;
case LSH:
lvalue <<= value;
lvalue = (uintmax_t)lvalue << (value & (TYPE_WIDTH(uintmax_t) - 1));
break;
case RSH:
lvalue >>= value;
lvalue >>= (value & (TYPE_WIDTH(uintmax_t) - 1));
break;
case BAND:
lvalue &= value;
@@ -841,7 +837,7 @@ expcompare (void)
static intmax_t
expshift (void)
{
register intmax_t val1, val2;
intmax_t val1, val2;
val1 = expaddsub ();
@@ -853,9 +849,9 @@ expshift (void)
val2 = expaddsub ();
if (op == LSH)
val1 = val1 << val2;
val1 = (uintmax_t)val1 << (val2 & (TYPE_WIDTH(uintmax_t) - 1));
else
val1 = val1 >> val2;
val1 = val1 >> (val2 & (TYPE_WIDTH(uintmax_t) - 1));
lasttok = NUM;
}