ash: fix "shift BIGNUM" and "read with no variable name" bugs.
omg. hush testsuite helps to find bugs in ash! what next? function old new delta static.arg_REPLY - 8 +8 readcmd 1023 1021 -2 shiftcmd 129 125 -4 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/2 up/down: 8/-6) Total: 2 bytes
This commit is contained in:
parent
1ba323e5b6
commit
9cd4c76b50
@ -9549,7 +9549,7 @@ shiftcmd(int argc ATTRIBUTE_UNUSED, char **argv)
|
|||||||
if (argv[1])
|
if (argv[1])
|
||||||
n = number(argv[1]);
|
n = number(argv[1]);
|
||||||
if (n > shellparam.nparam)
|
if (n > shellparam.nparam)
|
||||||
ash_msg_and_raise_error("can't shift that many");
|
n = shellparam.nparam;
|
||||||
INT_OFF;
|
INT_OFF;
|
||||||
shellparam.nparam -= n;
|
shellparam.nparam -= n;
|
||||||
for (ap1 = shellparam.p; --n >= 0; ap1++) {
|
for (ap1 = shellparam.p; --n >= 0; ap1++) {
|
||||||
@ -11994,6 +11994,8 @@ typedef enum __rlimit_resource rlim_t;
|
|||||||
static int
|
static int
|
||||||
readcmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
|
readcmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
|
static const char *const arg_REPLY[] = { "REPLY", NULL };
|
||||||
|
|
||||||
char **ap;
|
char **ap;
|
||||||
int backslash;
|
int backslash;
|
||||||
char c;
|
char c;
|
||||||
@ -12086,7 +12088,7 @@ readcmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
|
|||||||
}
|
}
|
||||||
ap = argptr;
|
ap = argptr;
|
||||||
if (*ap == NULL)
|
if (*ap == NULL)
|
||||||
ash_msg_and_raise_error("arg count");
|
ap = (char**)arg_REPLY;
|
||||||
ifs = bltinlookup("IFS");
|
ifs = bltinlookup("IFS");
|
||||||
if (ifs == NULL)
|
if (ifs == NULL)
|
||||||
ifs = defifs;
|
ifs = defifs;
|
||||||
|
Loading…
Reference in New Issue
Block a user