Patch from Rob Landley, Simplify organisation of arguments.
This commit is contained in:
parent
91b3d460c7
commit
cb920d9778
@ -98,7 +98,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
int busybox_main(int argc, char **argv)
|
int busybox_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int col = 0, len, i;
|
int col = 0;
|
||||||
|
|
||||||
#ifdef CONFIG_FEATURE_INSTALLER
|
#ifdef CONFIG_FEATURE_INSTALLER
|
||||||
/*
|
/*
|
||||||
@ -161,18 +161,7 @@ int busybox_main(int argc, char **argv)
|
|||||||
/* Flag that we've been here already */
|
/* Flag that we've been here already */
|
||||||
been_there_done_that = 1;
|
been_there_done_that = 1;
|
||||||
|
|
||||||
/* Move the command line down a notch */
|
return (main(argc-1, argv+1));
|
||||||
len = argv[argc] + strlen(argv[argc]) - argv[1];
|
|
||||||
memmove(argv[0], argv[1], len);
|
|
||||||
memset(argv[0] + len, 0, argv[1] - argv[0]);
|
|
||||||
|
|
||||||
/* Fix up the argv pointers */
|
|
||||||
len = argv[1] - argv[0];
|
|
||||||
memmove(argv, argv + 1, sizeof(char *) * (argc + 1));
|
|
||||||
for (i = 0; i < argc; i++)
|
|
||||||
argv[i] -= len;
|
|
||||||
|
|
||||||
return (main(argc, argv));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user