Skip to content

Commit

Permalink
Fix a crash in shcomp while parsing arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
siteshwar authored and krader1961 committed Nov 27, 2017
1 parent 83bbd5d commit b5f94f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cmd/ksh93/sh/shcomp.c
Expand Up @@ -76,6 +76,8 @@ int main(int argc, char *argv[])
char *cp;
int n, nflag=0, vflag=0, dflag=0;
error_info.id = argv[0];

shp = sh_init(argc,argv,(Shinit_f)0);
while(n = optget(argv, usage )) switch(n)
{
case 'D':
Expand All @@ -94,7 +96,6 @@ int main(int argc, char *argv[])
errormsg(SH_DICT,ERROR_usage(2),"%s",opt_info.arg);
break;
}
shp = sh_init(argc,argv,(Shinit_f)0);
shp->shcomp = 1;
argv += opt_info.index;
argc -= opt_info.index;
Expand Down

0 comments on commit b5f94f2

Please sign in to comment.