Ignore:
Timestamp:
Oct 6, 2007, 11:19:19 PM (18 years ago)
Author:
bird
Message:

moving globals into shinstance...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/histedit.c

    r809 r1198  
    9191        FILE *el_err;
    9292
    93 #define editing (Eflag || Vflag)
    94 
    95         if (iflag) {
     93#define editing (Eflag(psh) || Vflag(psh))
     94
     95        if (iflag(psh)) {
    9696                if (!hist) {
    9797                        /*
     
    154154                }
    155155                if (el) {
    156                         if (Vflag)
     156                        if (Vflag(psh))
    157157                                el_set(el, EL_EDITOR, "vi");
    158                         else if (Eflag)
     158                        else if (Eflag(psh))
    159159                                el_set(el, EL_EDITOR, "emacs");
    160160                        el_set(el, EL_BIND, "^I",
    161                             tabcomplete ? "rl-complete" : "ed-insert", NULL);
     161                            tabcomplete(psh) ? "rl-complete" : "ed-insert", NULL);
    162162                        el_source(el, NULL);
    163163                }
     
    418418                                }
    419419
    420                                 evalstring(strcpy(stalloc(strlen(s) + 1), s), 0);
     420                                evalstring(strcpy(stalloc(psh, strlen(s) + 1), s), 0);
    421421                                if (displayhist && hist) {
    422422                                        /*
     
    440440
    441441                fclose(efp);
    442                 editcmd = stalloc(strlen(editor) + strlen(editfile) + 2);
     442                editcmd = stalloc(psh, strlen(editor) + strlen(editfile) + 2);
    443443                sprintf(editcmd, "%s %s", editor, editfile);
    444444                evalstring(editcmd, 0); /* XXX - should use no JC command */
     
    461461        int plen = strlen(p);
    462462
    463         STARTSTACKSTR(dest);
     463        STARTSTACKSTR(psh, dest);
    464464        while (*s) {
    465465                if (*s == *p && strncmp(s, p, plen) == 0) {
    466466                        while (*r)
    467                                 STPUTC(*r++, dest);
     467                                STPUTC(psh, *r++, dest);
    468468                        s += plen;
    469469                        *p = '\0';      /* so no more matches */
    470470                } else
    471                         STPUTC(*s++, dest);
    472         }
    473         STACKSTRNUL(dest);
    474         dest = grabstackstr(dest);
     471                        STPUTC(psh, *s++, dest);
     472        }
     473        STACKSTRNUL(psh, dest);
     474        dest = grabstackstr(psh, dest);
    475475
    476476        return (dest);
     
    537537#else
    538538int
    539 histcmd(int argc, char **argv)
    540 {
    541         error("not compiled with history support");
     539histcmd(shinstance *psh, int argc, char **argv)
     540{
     541        error(psh, "not compiled with history support");
    542542        /* NOTREACHED */
     543        return -1;
    543544}
    544545int
    545 inputrc(int argc, char **argv)
    546 {
    547         error("not compiled with history support");
     546inputrc(shinstance *psh, int argc, char **argv)
     547{
     548        error(psh, "not compiled with history support");
    548549        /* NOTREACHED */
    549 }
    550 #endif
     550        return -1;
     551}
     552#endif
Note: See TracChangeset for help on using the changeset viewer.