rc: do not mess up argv
This commit is contained in:
parent
1c4a04cd30
commit
a0f7e71d41
|
@ -143,9 +143,11 @@ void
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
code bootstrap[17];
|
code bootstrap[17];
|
||||||
char num[12], *rcmain;
|
char num[12], *rcmain, **argvcopy;
|
||||||
int i;
|
int i;
|
||||||
argc = getflags(argc, argv, "SsrdiIlxepvVc:1m:1[command]", 1);
|
argvcopy = mallocz(sizeof(char*)*(argc+1), 1);
|
||||||
|
memmove(argvcopy, argv, argc*sizeof(char*));
|
||||||
|
argc = getflags(argc, argvcopy, "SsrdiIlxepvVc:1m:1[command]", 1);
|
||||||
if(argc==-1)
|
if(argc==-1)
|
||||||
usage("[file [arg ...]]");
|
usage("[file [arg ...]]");
|
||||||
if(argv[0][0]=='-')
|
if(argv[0][0]=='-')
|
||||||
|
|
Loading…
Reference in New Issue