rc: do not mess up argv

This commit is contained in:
Giacomo Tesio 2017-08-11 02:10:02 +02:00
parent 1c4a04cd30
commit a0f7e71d41
1 changed files with 4 additions and 2 deletions

View File

@ -143,9 +143,11 @@ void
main(int argc, char *argv[])
{
code bootstrap[17];
char num[12], *rcmain;
char num[12], *rcmain, **argvcopy;
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)
usage("[file [arg ...]]");
if(argv[0][0]=='-')