Ignore:
Timestamp:
Oct 7, 2007, 12:04:05 AM (18 years ago)
Author:
bird
Message:

moving globals into shinstance...

File:
1 edited

Legend:

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

    r1198 r1199  
    105105                                sethistsize(histsizeval());
    106106                        else
    107                                 out2str("sh: can't initialize history\n");
     107                                out2str(psh, "sh: can't initialize history\n");
    108108                }
    109109                if (editing && !el && isatty(0)) { /* && isatty(2) ??? */
     
    144144                        } else {
    145145bad:
    146                                 out2str("sh: can't initialize editing\n");
     146                                out2str(psh, "sh: can't initialize editing\n");
    147147                        }
    148148                        INTON;
     
    207207{
    208208        if (argc != 2) {
    209                 out2str("usage: inputrc file\n");
     209                out2str(psh, "usage: inputrc file\n");
    210210                return 1;
    211211        }
    212212        if (el != NULL) {
    213213                if (el_source(el, argv[1])) {
    214                         out2str("inputrc: failed\n");
     214                        out2str(psh, "inputrc: failed\n");
    215215                        return 1;
    216216                } else
    217217                        return 0;
    218218        } else {
    219                 out2str("sh: inputrc ignored, not editing\n");
     219                out2str(psh, "sh: inputrc ignored, not editing\n");
    220220                return 1;
    221221        }
     
    259259
    260260        if (hist == NULL)
    261                 error("history not active");
     261                error(psh, "history not active");
    262262
    263263        if (argc == 1)
    264                 error("missing history argument");
     264                error(psh, "missing history argument");
    265265
    266266        optreset = 1; optind = 1; /* initialize getopt */
     
    284284                        break;
    285285                case ':':
    286                         error("option -%c expects argument", optopt);
     286                        error(psh, "option -%c expects argument", optopt);
    287287                        /* NOTREACHED */
    288288                case '?':
    289289                default:
    290                         error("unknown option: -%c", optopt);
     290                        error(psh, "unknown option: -%c", optopt);
    291291                        /* NOTREACHED */
    292292                }
     
    315315                        active = 0;
    316316                        displayhist = 0;
    317                         error("called recursively too many times");
     317                        error(psh, "called recursively too many times");
    318318                }
    319319                /*
     
    358358                break;
    359359        default:
    360                 error("too many args");
     360                error(psh, "too many args");
    361361                /* NOTREACHED */
    362362        }
     
    387387                snprintf(editfile, sizeof(editfile), "%s_shXXXXXX", _PATH_TMP);
    388388                if ((fd = mkstemp(editfile)) < 0)
    389                         error("can't create temporary file %s", editfile);
     389                        error(psh, "can't create temporary file %s", editfile);
    390390                if ((efp = fdopen(fd, "w")) == NULL) {
    391391                        close(fd);
    392                         error("can't allocate stdio buffer for temp");
     392                        error(psh, "can't allocate stdio buffer for temp");
    393393                }
    394394        }
     
    407407                if (lflg) {
    408408                        if (!nflg)
    409                                 out1fmt("%5d ", he.num);
    410                         out1str(he.str);
     409                                out1fmt(psh, "%5d ", he.num);
     410                        out1str(psh, he.str);
    411411                } else {
    412412                        const char *s = pat ?
     
    415415                        if (sflg) {
    416416                                if (displayhist) {
    417                                         out2str(s);
     417                                        out2str(psh, s);
    418418                                }
    419419
     
    523523                }
    524524                if (retval == -1)
    525                         error("history number %s not found (internal error)",
     525                        error(psh, "history number %s not found (internal error)",
    526526                               str);
    527527        } else {
     
    531531                retval = history(hist, &he, H_PREV_STR, str);
    532532                if (retval == -1)
    533                         error("history pattern not found: %s", str);
     533                        error(psh, "history pattern not found: %s", str);
    534534        }
    535535        return (he.num);
Note: See TracChangeset for help on using the changeset viewer.