Changeset 3438 for trunk/src/kash/main.c
- Timestamp:
- Sep 9, 2020, 10:01:39 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/main.c
r3435 r3438 45 45 #endif 46 46 47 #include <assert.h> 47 48 #include <errno.h> 48 49 #include <stdio.h> … … 101 102 102 103 int 103 #if K_OS == K_OS_WINDOWS 104 #if K_OS == K_OS_WINDOWS && defined(SH_FORKED_MODE) 104 105 real_main(int argc, char **argv, char **envp) 105 106 #else … … 130 131 * Create the root shell instance. 131 132 */ 132 psh = sh_create_root_shell( NULL, argc,argv, envp);133 psh = sh_create_root_shell(argv, envp); 133 134 if (!psh) 134 135 return 2; 135 136 shthread_set_shell(psh); 136 shell_main(psh, argc, psh-> argptr);137 shell_main(psh, argc, psh->orgargv); 137 138 /* Not reached. */ 138 139 return 89; … … 406 407 407 408 if (argc >= 2) { /* That's what SVR2 does */ 409 char * const savedcommandname = psh->commandname; 410 int const savedcommandnamemalloc = psh->commandnamemalloc; 408 411 char *fullname; 409 412 struct stackmark smark; … … 413 416 setinputfile(psh, fullname, 1); 414 417 psh->commandname = fullname; 418 psh->commandnamemalloc = 0; 415 419 cmdloop(psh, 0); 416 420 popfile(psh); 421 psh->commandname = savedcommandname; 422 psh->commandnamemalloc = savedcommandnamemalloc; 417 423 popstackmark(psh, &smark); 418 424 }
Note:
See TracChangeset
for help on using the changeset viewer.