mirror of
https://github.com/sheumann/hush.git
synced 2024-12-23 05:29:58 +00:00
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