Changeset 1198 for trunk/src/kash/histedit.c
- Timestamp:
- Oct 6, 2007, 11:19:19 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/histedit.c
r809 r1198 91 91 FILE *el_err; 92 92 93 #define editing (Eflag || Vflag)94 95 if (iflag ) {93 #define editing (Eflag(psh) || Vflag(psh)) 94 95 if (iflag(psh)) { 96 96 if (!hist) { 97 97 /* … … 154 154 } 155 155 if (el) { 156 if (Vflag )156 if (Vflag(psh)) 157 157 el_set(el, EL_EDITOR, "vi"); 158 else if (Eflag )158 else if (Eflag(psh)) 159 159 el_set(el, EL_EDITOR, "emacs"); 160 160 el_set(el, EL_BIND, "^I", 161 tabcomplete ? "rl-complete" : "ed-insert", NULL);161 tabcomplete(psh) ? "rl-complete" : "ed-insert", NULL); 162 162 el_source(el, NULL); 163 163 } … … 418 418 } 419 419 420 evalstring(strcpy(stalloc( strlen(s) + 1), s), 0);420 evalstring(strcpy(stalloc(psh, strlen(s) + 1), s), 0); 421 421 if (displayhist && hist) { 422 422 /* … … 440 440 441 441 fclose(efp); 442 editcmd = stalloc( strlen(editor) + strlen(editfile) + 2);442 editcmd = stalloc(psh, strlen(editor) + strlen(editfile) + 2); 443 443 sprintf(editcmd, "%s %s", editor, editfile); 444 444 evalstring(editcmd, 0); /* XXX - should use no JC command */ … … 461 461 int plen = strlen(p); 462 462 463 STARTSTACKSTR( dest);463 STARTSTACKSTR(psh, dest); 464 464 while (*s) { 465 465 if (*s == *p && strncmp(s, p, plen) == 0) { 466 466 while (*r) 467 STPUTC( *r++, dest);467 STPUTC(psh, *r++, dest); 468 468 s += plen; 469 469 *p = '\0'; /* so no more matches */ 470 470 } 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); 475 475 476 476 return (dest); … … 537 537 #else 538 538 int 539 histcmd( int argc, char **argv)540 { 541 error( "not compiled with history support");539 histcmd(shinstance *psh, int argc, char **argv) 540 { 541 error(psh, "not compiled with history support"); 542 542 /* NOTREACHED */ 543 return -1; 543 544 } 544 545 int 545 inputrc( int argc, char **argv)546 { 547 error( "not compiled with history support");546 inputrc(shinstance *psh, int argc, char **argv) 547 { 548 error(psh, "not compiled with history support"); 548 549 /* NOTREACHED */ 549 } 550 #endif 550 return -1; 551 } 552 #endif
Note:
See TracChangeset
for help on using the changeset viewer.