Changeset 1199 for trunk/src/kash/histedit.c
- Timestamp:
- Oct 7, 2007, 12:04:05 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/histedit.c
r1198 r1199 105 105 sethistsize(histsizeval()); 106 106 else 107 out2str( "sh: can't initialize history\n");107 out2str(psh, "sh: can't initialize history\n"); 108 108 } 109 109 if (editing && !el && isatty(0)) { /* && isatty(2) ??? */ … … 144 144 } else { 145 145 bad: 146 out2str( "sh: can't initialize editing\n");146 out2str(psh, "sh: can't initialize editing\n"); 147 147 } 148 148 INTON; … … 207 207 { 208 208 if (argc != 2) { 209 out2str( "usage: inputrc file\n");209 out2str(psh, "usage: inputrc file\n"); 210 210 return 1; 211 211 } 212 212 if (el != NULL) { 213 213 if (el_source(el, argv[1])) { 214 out2str( "inputrc: failed\n");214 out2str(psh, "inputrc: failed\n"); 215 215 return 1; 216 216 } else 217 217 return 0; 218 218 } else { 219 out2str( "sh: inputrc ignored, not editing\n");219 out2str(psh, "sh: inputrc ignored, not editing\n"); 220 220 return 1; 221 221 } … … 259 259 260 260 if (hist == NULL) 261 error( "history not active");261 error(psh, "history not active"); 262 262 263 263 if (argc == 1) 264 error( "missing history argument");264 error(psh, "missing history argument"); 265 265 266 266 optreset = 1; optind = 1; /* initialize getopt */ … … 284 284 break; 285 285 case ':': 286 error( "option -%c expects argument", optopt);286 error(psh, "option -%c expects argument", optopt); 287 287 /* NOTREACHED */ 288 288 case '?': 289 289 default: 290 error( "unknown option: -%c", optopt);290 error(psh, "unknown option: -%c", optopt); 291 291 /* NOTREACHED */ 292 292 } … … 315 315 active = 0; 316 316 displayhist = 0; 317 error( "called recursively too many times");317 error(psh, "called recursively too many times"); 318 318 } 319 319 /* … … 358 358 break; 359 359 default: 360 error( "too many args");360 error(psh, "too many args"); 361 361 /* NOTREACHED */ 362 362 } … … 387 387 snprintf(editfile, sizeof(editfile), "%s_shXXXXXX", _PATH_TMP); 388 388 if ((fd = mkstemp(editfile)) < 0) 389 error( "can't create temporary file %s", editfile);389 error(psh, "can't create temporary file %s", editfile); 390 390 if ((efp = fdopen(fd, "w")) == NULL) { 391 391 close(fd); 392 error( "can't allocate stdio buffer for temp");392 error(psh, "can't allocate stdio buffer for temp"); 393 393 } 394 394 } … … 407 407 if (lflg) { 408 408 if (!nflg) 409 out1fmt( "%5d ", he.num);410 out1str( he.str);409 out1fmt(psh, "%5d ", he.num); 410 out1str(psh, he.str); 411 411 } else { 412 412 const char *s = pat ? … … 415 415 if (sflg) { 416 416 if (displayhist) { 417 out2str( s);417 out2str(psh, s); 418 418 } 419 419 … … 523 523 } 524 524 if (retval == -1) 525 error( "history number %s not found (internal error)",525 error(psh, "history number %s not found (internal error)", 526 526 str); 527 527 } else { … … 531 531 retval = history(hist, &he, H_PREV_STR, str); 532 532 if (retval == -1) 533 error( "history pattern not found: %s", str);533 error(psh, "history pattern not found: %s", str); 534 534 } 535 535 return (he.num);
Note:
See TracChangeset
for help on using the changeset viewer.