Changeset 881 for trunk/src/ash-messup/main.c
- Timestamp:
- Apr 21, 2007, 10:47:37 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ash-messup/main.c
r880 r881 78 78 #include "exec.h" 79 79 #include "cd.h" 80 #include "shinstance.h" 80 81 81 82 #define PROFILE 0 … … 86 87 STATIC union node *prevcmd; 87 88 88 STATIC void read_profile( const char *);89 STATIC char *find_dot_file( char *);89 STATIC void read_profile(struct shinstance *, const char *); 90 STATIC char *find_dot_file(struct shinstance *, char *); 90 91 int main(int, char **); 91 92 int shell_main(shinstance *, int, char **); … … 121 122 return 2; 122 123 shthread_set_shell(psh); 123 return shell_main(psh, argc );124 return shell_main(psh, argc, argv); 124 125 } 125 126 … … 144 145 psh->rootshell = 1; 145 146 psh->minusc = NULL; 146 psh->state = 3;147 state = 3; 147 148 break; 148 149 … … 160 161 161 162 if (psh->exception != EXSHELLPROC) { 162 if (state == 0 || iflag == 0 || ! psh->rootshell)163 exitshell(psh, exitstatus);163 if (state == 0 || psh->iflag == 0 || ! psh->rootshell) 164 exitshell(psh, psh->exitstatus); 164 165 } 165 166 reset(psh); … … 170 171 ) { 171 172 out2c(psh, '\n'); 172 flushout(& errout);173 flushout(&psh->errout); 173 174 } 174 175 popstackmark(psh, &smark); … … 232 233 evalstring(psh, psh->minusc, 0); 233 234 234 if (psh->sflag || minusc == NULL) {235 if (psh->sflag || psh->minusc == NULL) { 235 236 state4: /* XXX ??? - why isn't this before the "if" statement */ 236 237 cmdloop(psh, 1); … … 238 239 exitshell(psh, psh->exitstatus); 239 240 /* NOTREACHED */ 241 return 1; 240 242 } 241 243 … … 343 345 setinputfd(psh, fd, 1); 344 346 else 345 error( "Can't open %s", name);347 error(psh, "Can't open %s", name); 346 348 INTON; 347 349 cmdloop(psh, 0); … … 380 382 381 383 /* not found in the PATH */ 382 error( "%s: not found", basename);384 error(psh, "%s: not found", basename); 383 385 /* NOTREACHED */ 386 return NULL; 384 387 } 385 388 … … 412 415 if (argc > 1) 413 416 psh->exitstatus = number(argv[1]); 414 exitshell(psh, exitstatus);417 exitshell(psh, psh->exitstatus); 415 418 /* NOTREACHED */ 419 return 1; 416 420 } 417 421
Note:
See TracChangeset
for help on using the changeset viewer.