aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-04-12 19:12:13 +0000
committerEric Andersen <andersen@codepoet.org>2004-04-12 19:12:13 +0000
commit1e6aba967ce2e1225e7ed566e5b83cbfb117b6b4 (patch)
tree41aac1a849ce4ffe49359736f0c3419a8bf4489e
parente3efc9230c2f192e2738cee733c6d4fa20a2be2a (diff)
downloadbusybox-w32-1e6aba967ce2e1225e7ed566e5b83cbfb117b6b4.tar.gz
busybox-w32-1e6aba967ce2e1225e7ed566e5b83cbfb117b6b4.tar.bz2
busybox-w32-1e6aba967ce2e1225e7ed566e5b83cbfb117b6b4.zip
Peter Milne writes:
Just upgraded from 0.6 to 1.00-pre8 Dot command handling handled args correctly (same as bash) in 0.60, but failed in 1.00: I fixed this by reverting the dotcmd function back to previous 0.60 instantiation, please consider using the older version. Thanks Peter
-rw-r--r--shell/ash.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 1a0e0aa6e..977ae4647 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -8125,21 +8125,40 @@ find_dot_file(char *name)
8125 /* NOTREACHED */ 8125 /* NOTREACHED */
8126} 8126}
8127 8127
8128int 8128static int dotcmd(int argc, char **argv)
8129dotcmd(int argc, char **argv)
8130{ 8129{
8130 struct strlist *sp;
8131 volatile struct shparam saveparam;
8132
8131 exitstatus = 0; 8133 exitstatus = 0;
8132 8134
8133 if (argc >= 2) { /* That's what SVR2 does */ 8135 for (sp = cmdenviron; sp; sp = sp->next)
8136 setvareq(bb_xstrdup(sp->text), VSTRFIXED | VTEXTFIXED);
8137
8138 if (argc >= 2) { /* That's what SVR2 does */
8134 char *fullname; 8139 char *fullname;
8135 struct stackmark smark; 8140 struct stackmark smark;
8136 8141
8137 setstackmark(&smark); 8142 setstackmark(&smark);
8138 fullname = find_dot_file(argv[1]); 8143 fullname = find_dot_file(argv[1]);
8144
8145 if (argc > 2) {
8146 saveparam = shellparam;
8147 shellparam.malloc = 0;
8148 shellparam.nparam = argc - 2;
8149 shellparam.p = argv + 2;
8150 };
8151
8139 setinputfile(fullname, 1); 8152 setinputfile(fullname, 1);
8140 commandname = fullname; 8153 commandname = fullname;
8141 cmdloop(0); 8154 cmdloop(0);
8142 popfile(); 8155 popfile();
8156
8157 if (argc > 2) {
8158 freeparam(&shellparam);
8159 shellparam = saveparam;
8160 };
8161
8143 popstackmark(&smark); 8162 popstackmark(&smark);
8144 } 8163 }
8145 return exitstatus; 8164 return exitstatus;