Allow assignments in the export and readonly commands.
This commit is contained in:
parent
ab6526c8b3
commit
f69bfc76fa
10
msh.c
10
msh.c
@ -3331,11 +3331,19 @@ void (*f)();
|
|||||||
int key;
|
int key;
|
||||||
{
|
{
|
||||||
if (*wp != NULL) {
|
if (*wp != NULL) {
|
||||||
for (; *wp != NULL; wp++)
|
for (; *wp != NULL; wp++) {
|
||||||
|
if (isassign(*wp)) {
|
||||||
|
char *cp;
|
||||||
|
assign(*wp, COPYV);
|
||||||
|
for (cp = *wp; *cp != '='; cp++)
|
||||||
|
;
|
||||||
|
*cp = '\0';
|
||||||
|
}
|
||||||
if (checkname(*wp))
|
if (checkname(*wp))
|
||||||
(*f)(lookup(*wp));
|
(*f)(lookup(*wp));
|
||||||
else
|
else
|
||||||
badid(*wp);
|
badid(*wp);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
putvlist(key, 1);
|
putvlist(key, 1);
|
||||||
}
|
}
|
||||||
|
10
shell/msh.c
10
shell/msh.c
@ -3331,11 +3331,19 @@ void (*f)();
|
|||||||
int key;
|
int key;
|
||||||
{
|
{
|
||||||
if (*wp != NULL) {
|
if (*wp != NULL) {
|
||||||
for (; *wp != NULL; wp++)
|
for (; *wp != NULL; wp++) {
|
||||||
|
if (isassign(*wp)) {
|
||||||
|
char *cp;
|
||||||
|
assign(*wp, COPYV);
|
||||||
|
for (cp = *wp; *cp != '='; cp++)
|
||||||
|
;
|
||||||
|
*cp = '\0';
|
||||||
|
}
|
||||||
if (checkname(*wp))
|
if (checkname(*wp))
|
||||||
(*f)(lookup(*wp));
|
(*f)(lookup(*wp));
|
||||||
else
|
else
|
||||||
badid(*wp);
|
badid(*wp);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
putvlist(key, 1);
|
putvlist(key, 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user