Allow assignments in the export and readonly commands.
authorMatt Kraai <kraai@debian.org>
Thu, 12 Jul 2001 19:39:59 +0000 (19:39 -0000)
committerMatt Kraai <kraai@debian.org>
Thu, 12 Jul 2001 19:39:59 +0000 (19:39 -0000)
msh.c
shell/msh.c

diff --git a/msh.c b/msh.c
index efba6a1ee22ccc806d4c0551e10e727d03ad5083..230d74f5a1ad6dda410a11e48fbdb1d2bb4ff761 100644 (file)
--- a/msh.c
+++ b/msh.c
@@ -3331,11 +3331,19 @@ void (*f)();
 int key;
 {
        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))
                                (*f)(lookup(*wp));
                        else
                                badid(*wp);
+               }
        } else
                putvlist(key, 1);
 }
index efba6a1ee22ccc806d4c0551e10e727d03ad5083..230d74f5a1ad6dda410a11e48fbdb1d2bb4ff761 100644 (file)
@@ -3331,11 +3331,19 @@ void (*f)();
 int key;
 {
        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))
                                (*f)(lookup(*wp));
                        else
                                badid(*wp);
+               }
        } else
                putvlist(key, 1);
 }