Ignore:
Timestamp:
Apr 21, 2007, 10:47:37 AM (18 years ago)
Author:
bird
Message:

hacking...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ash-messup/main.c

    r880 r881  
    7878#include "exec.h"
    7979#include "cd.h"
     80#include "shinstance.h"
    8081
    8182#define PROFILE 0
     
    8687STATIC union node *prevcmd;
    8788
    88 STATIC void read_profile(const char *);
    89 STATIC char *find_dot_file(char *);
     89STATIC void read_profile(struct shinstance *, const char *);
     90STATIC char *find_dot_file(struct shinstance *, char *);
    9091int main(int, char **);
    9192int shell_main(shinstance *, int, char **);
     
    121122                return 2;
    122123        shthread_set_shell(psh);
    123         return shell_main(psh, argc);
     124        return shell_main(psh, argc, argv);
    124125}       
    125126
     
    144145                        psh->rootshell = 1;
    145146                        psh->minusc = NULL;
    146                         psh->state = 3;
     147                        state = 3;
    147148                        break;
    148149
     
    160161
    161162                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);
    164165                }
    165166                reset(psh);
     
    170171                 ) {
    171172                        out2c(psh, '\n');
    172                         flushout(&errout);
     173                        flushout(&psh->errout);
    173174                }
    174175                popstackmark(psh, &smark);
     
    232233                evalstring(psh, psh->minusc, 0);
    233234
    234         if (psh->sflag || minusc == NULL) {
     235        if (psh->sflag || psh->minusc == NULL) {
    235236state4: /* XXX ??? - why isn't this before the "if" statement */
    236237                cmdloop(psh, 1);
     
    238239        exitshell(psh, psh->exitstatus);
    239240        /* NOTREACHED */
     241        return 1;
    240242}
    241243
     
    343345                setinputfd(psh, fd, 1);
    344346        else
    345                 error("Can't open %s", name);
     347                error(psh, "Can't open %s", name);
    346348        INTON;
    347349        cmdloop(psh, 0);
     
    380382
    381383        /* not found in the PATH */
    382         error("%s: not found", basename);
     384        error(psh, "%s: not found", basename);
    383385        /* NOTREACHED */
     386        return NULL;
    384387}
    385388
     
    412415        if (argc > 1)
    413416                psh->exitstatus = number(argv[1]);
    414         exitshell(psh, exitstatus);
     417        exitshell(psh, psh->exitstatus);
    415418        /* NOTREACHED */
     419        return 1;
    416420}
    417421
Note: See TracChangeset for help on using the changeset viewer.