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
This commit is contained in:
parent
e3efc9230c
commit
1e6aba967c
23
shell/ash.c
23
shell/ash.c
@ -8125,21 +8125,40 @@ find_dot_file(char *name)
|
|||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int dotcmd(int argc, char **argv)
|
||||||
dotcmd(int argc, char **argv)
|
|
||||||
{
|
{
|
||||||
|
struct strlist *sp;
|
||||||
|
volatile struct shparam saveparam;
|
||||||
|
|
||||||
exitstatus = 0;
|
exitstatus = 0;
|
||||||
|
|
||||||
|
for (sp = cmdenviron; sp; sp = sp->next)
|
||||||
|
setvareq(bb_xstrdup(sp->text), VSTRFIXED | VTEXTFIXED);
|
||||||
|
|
||||||
if (argc >= 2) { /* That's what SVR2 does */
|
if (argc >= 2) { /* That's what SVR2 does */
|
||||||
char *fullname;
|
char *fullname;
|
||||||
struct stackmark smark;
|
struct stackmark smark;
|
||||||
|
|
||||||
setstackmark(&smark);
|
setstackmark(&smark);
|
||||||
fullname = find_dot_file(argv[1]);
|
fullname = find_dot_file(argv[1]);
|
||||||
|
|
||||||
|
if (argc > 2) {
|
||||||
|
saveparam = shellparam;
|
||||||
|
shellparam.malloc = 0;
|
||||||
|
shellparam.nparam = argc - 2;
|
||||||
|
shellparam.p = argv + 2;
|
||||||
|
};
|
||||||
|
|
||||||
setinputfile(fullname, 1);
|
setinputfile(fullname, 1);
|
||||||
commandname = fullname;
|
commandname = fullname;
|
||||||
cmdloop(0);
|
cmdloop(0);
|
||||||
popfile();
|
popfile();
|
||||||
|
|
||||||
|
if (argc > 2) {
|
||||||
|
freeparam(&shellparam);
|
||||||
|
shellparam = saveparam;
|
||||||
|
};
|
||||||
|
|
||||||
popstackmark(&smark);
|
popstackmark(&smark);
|
||||||
}
|
}
|
||||||
return exitstatus;
|
return exitstatus;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user