Allow assignments in the export and readonly commands.

This commit is contained in:
Matt Kraai 2001-07-12 19:39:59 +00:00
parent ab6526c8b3
commit f69bfc76fa
2 changed files with 18 additions and 2 deletions

10
msh.c
View File

@ -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);
} }

View File

@ -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);
} }