histedit.c revision 1.45 1 1.45 matt /* $NetBSD: histedit.c,v 1.45 2012/03/20 18:42:29 matt Exp $ */
2 1.6 cgd
3 1.1 jtc /*-
4 1.1 jtc * Copyright (c) 1993
5 1.1 jtc * The Regents of the University of California. All rights reserved.
6 1.1 jtc *
7 1.1 jtc * This code is derived from software contributed to Berkeley by
8 1.1 jtc * Kenneth Almquist.
9 1.1 jtc *
10 1.1 jtc * Redistribution and use in source and binary forms, with or without
11 1.1 jtc * modification, are permitted provided that the following conditions
12 1.1 jtc * are met:
13 1.1 jtc * 1. Redistributions of source code must retain the above copyright
14 1.1 jtc * notice, this list of conditions and the following disclaimer.
15 1.1 jtc * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 jtc * notice, this list of conditions and the following disclaimer in the
17 1.1 jtc * documentation and/or other materials provided with the distribution.
18 1.31 agc * 3. Neither the name of the University nor the names of its contributors
19 1.1 jtc * may be used to endorse or promote products derived from this software
20 1.1 jtc * without specific prior written permission.
21 1.1 jtc *
22 1.1 jtc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 1.1 jtc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 1.1 jtc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 1.1 jtc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 1.1 jtc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 1.1 jtc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 1.1 jtc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 1.1 jtc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 1.1 jtc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 1.1 jtc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 1.1 jtc * SUCH DAMAGE.
33 1.1 jtc */
34 1.1 jtc
35 1.14 christos #include <sys/cdefs.h>
36 1.1 jtc #ifndef lint
37 1.6 cgd #if 0
38 1.8 christos static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
39 1.6 cgd #else
40 1.45 matt __RCSID("$NetBSD: histedit.c,v 1.45 2012/03/20 18:42:29 matt Exp $");
41 1.6 cgd #endif
42 1.1 jtc #endif /* not lint */
43 1.1 jtc
44 1.1 jtc #include <sys/param.h>
45 1.1 jtc #include <paths.h>
46 1.1 jtc #include <stdio.h>
47 1.2 jtc #include <stdlib.h>
48 1.2 jtc #include <unistd.h>
49 1.8 christos /*
50 1.8 christos * Editline and history functions (and glue).
51 1.8 christos */
52 1.1 jtc #include "shell.h"
53 1.1 jtc #include "parser.h"
54 1.1 jtc #include "var.h"
55 1.1 jtc #include "options.h"
56 1.43 christos #include "builtins.h"
57 1.8 christos #include "main.h"
58 1.4 cgd #include "output.h"
59 1.1 jtc #include "mystring.h"
60 1.8 christos #include "myhistedit.h"
61 1.1 jtc #include "error.h"
62 1.17 cjs #ifndef SMALL
63 1.5 cgd #include "eval.h"
64 1.1 jtc #include "memalloc.h"
65 1.1 jtc
66 1.1 jtc #define MAXHISTLOOPS 4 /* max recursions through fc */
67 1.1 jtc #define DEFEDITOR "ed" /* default editor *should* be $EDITOR */
68 1.1 jtc
69 1.1 jtc History *hist; /* history cookie */
70 1.1 jtc EditLine *el; /* editline cookie */
71 1.1 jtc int displayhist;
72 1.1 jtc static FILE *el_in, *el_out;
73 1.35 dsl unsigned char _el_fn_complete(EditLine *, int);
74 1.1 jtc
75 1.27 christos STATIC const char *fc_replace(const char *, char *, char *);
76 1.27 christos
77 1.27 christos #ifdef DEBUG
78 1.27 christos extern FILE *tracefile;
79 1.27 christos #endif
80 1.1 jtc
81 1.1 jtc /*
82 1.1 jtc * Set history and editing status. Called whenever the status may
83 1.1 jtc * have changed (figures out what to do).
84 1.1 jtc */
85 1.5 cgd void
86 1.27 christos histedit(void)
87 1.4 cgd {
88 1.27 christos FILE *el_err;
89 1.1 jtc
90 1.1 jtc #define editing (Eflag || Vflag)
91 1.1 jtc
92 1.37 christos if (iflag == 1) {
93 1.1 jtc if (!hist) {
94 1.1 jtc /*
95 1.1 jtc * turn history on
96 1.1 jtc */
97 1.1 jtc INTOFF;
98 1.1 jtc hist = history_init();
99 1.1 jtc INTON;
100 1.1 jtc
101 1.1 jtc if (hist != NULL)
102 1.9 christos sethistsize(histsizeval());
103 1.1 jtc else
104 1.1 jtc out2str("sh: can't initialize history\n");
105 1.1 jtc }
106 1.1 jtc if (editing && !el && isatty(0)) { /* && isatty(2) ??? */
107 1.1 jtc /*
108 1.1 jtc * turn editing on
109 1.1 jtc */
110 1.34 lukem char *term, *shname;
111 1.32 lukem
112 1.1 jtc INTOFF;
113 1.1 jtc if (el_in == NULL)
114 1.1 jtc el_in = fdopen(0, "r");
115 1.1 jtc if (el_out == NULL)
116 1.1 jtc el_out = fdopen(2, "w");
117 1.1 jtc if (el_in == NULL || el_out == NULL)
118 1.1 jtc goto bad;
119 1.27 christos el_err = el_out;
120 1.27 christos #if DEBUG
121 1.27 christos if (tracefile)
122 1.27 christos el_err = tracefile;
123 1.27 christos #endif
124 1.32 lukem term = lookupvar("TERM");
125 1.32 lukem if (term)
126 1.32 lukem setenv("TERM", term, 1);
127 1.32 lukem else
128 1.32 lukem unsetenv("TERM");
129 1.34 lukem shname = arg0;
130 1.34 lukem if (shname[0] == '-')
131 1.34 lukem shname++;
132 1.34 lukem el = el_init(shname, el_in, el_out, el_err);
133 1.1 jtc if (el != NULL) {
134 1.1 jtc if (hist)
135 1.1 jtc el_set(el, EL_HIST, history, hist);
136 1.1 jtc el_set(el, EL_PROMPT, getprompt);
137 1.33 christos el_set(el, EL_SIGNAL, 1);
138 1.36 christos el_set(el, EL_ADDFN, "rl-complete",
139 1.36 christos "ReadLine compatible completion function",
140 1.36 christos _el_fn_complete);
141 1.1 jtc } else {
142 1.1 jtc bad:
143 1.1 jtc out2str("sh: can't initialize editing\n");
144 1.1 jtc }
145 1.1 jtc INTON;
146 1.1 jtc } else if (!editing && el) {
147 1.1 jtc INTOFF;
148 1.1 jtc el_end(el);
149 1.1 jtc el = NULL;
150 1.1 jtc INTON;
151 1.1 jtc }
152 1.1 jtc if (el) {
153 1.42 jmmv el_source(el, NULL);
154 1.1 jtc if (Vflag)
155 1.1 jtc el_set(el, EL_EDITOR, "vi");
156 1.1 jtc else if (Eflag)
157 1.1 jtc el_set(el, EL_EDITOR, "emacs");
158 1.36 christos el_set(el, EL_BIND, "^I",
159 1.36 christos tabcomplete ? "rl-complete" : "ed-insert", NULL);
160 1.1 jtc }
161 1.1 jtc } else {
162 1.1 jtc INTOFF;
163 1.1 jtc if (el) { /* no editing if not interactive */
164 1.1 jtc el_end(el);
165 1.1 jtc el = NULL;
166 1.1 jtc }
167 1.1 jtc if (hist) {
168 1.1 jtc history_end(hist);
169 1.1 jtc hist = NULL;
170 1.1 jtc }
171 1.1 jtc INTON;
172 1.1 jtc }
173 1.1 jtc }
174 1.1 jtc
175 1.4 cgd
176 1.4 cgd void
177 1.27 christos sethistsize(const char *hs)
178 1.8 christos {
179 1.1 jtc int histsize;
180 1.16 christos HistEvent he;
181 1.1 jtc
182 1.1 jtc if (hist != NULL) {
183 1.10 christos if (hs == NULL || *hs == '\0' ||
184 1.9 christos (histsize = atoi(hs)) < 0)
185 1.1 jtc histsize = 100;
186 1.19 christos history(hist, &he, H_SETSIZE, histsize);
187 1.41 joerg history(hist, &he, H_SETUNIQUE, 1);
188 1.1 jtc }
189 1.13 christos }
190 1.13 christos
191 1.13 christos void
192 1.27 christos setterm(const char *term)
193 1.13 christos {
194 1.13 christos if (el != NULL && term != NULL)
195 1.13 christos if (el_set(el, EL_TERMINAL, term) != 0) {
196 1.13 christos outfmt(out2, "sh: Can't set terminal type %s\n", term);
197 1.13 christos outfmt(out2, "sh: Using dumb terminal settings.\n");
198 1.13 christos }
199 1.1 jtc }
200 1.1 jtc
201 1.28 gmcgarry int
202 1.45 matt inputrc(int argc, char **argv)
203 1.28 gmcgarry {
204 1.28 gmcgarry if (argc != 2) {
205 1.28 gmcgarry out2str("usage: inputrc file\n");
206 1.28 gmcgarry return 1;
207 1.28 gmcgarry }
208 1.28 gmcgarry if (el != NULL) {
209 1.28 gmcgarry if (el_source(el, argv[1])) {
210 1.28 gmcgarry out2str("inputrc: failed\n");
211 1.28 gmcgarry return 1;
212 1.28 gmcgarry } else
213 1.28 gmcgarry return 0;
214 1.28 gmcgarry } else {
215 1.28 gmcgarry out2str("sh: inputrc ignored, not editing\n");
216 1.28 gmcgarry return 1;
217 1.28 gmcgarry }
218 1.28 gmcgarry }
219 1.28 gmcgarry
220 1.1 jtc /*
221 1.1 jtc * This command is provided since POSIX decided to standardize
222 1.1 jtc * the Korn shell fc command. Oh well...
223 1.1 jtc */
224 1.4 cgd int
225 1.27 christos histcmd(int argc, char **argv)
226 1.1 jtc {
227 1.1 jtc int ch;
228 1.40 christos const char * volatile editor = NULL;
229 1.16 christos HistEvent he;
230 1.40 christos int lflg = 0;
231 1.40 christos volatile int nflg = 0, rflg = 0, sflg = 0;
232 1.16 christos int i, retval;
233 1.21 christos const char *firststr, *laststr;
234 1.1 jtc int first, last, direction;
235 1.1 jtc char *pat = NULL, *repl; /* ksh "fc old=new" crap */
236 1.1 jtc static int active = 0;
237 1.1 jtc struct jmploc jmploc;
238 1.1 jtc struct jmploc *volatile savehandler;
239 1.1 jtc char editfile[MAXPATHLEN + 1];
240 1.1 jtc FILE *efp;
241 1.8 christos #ifdef __GNUC__
242 1.39 mrg repl = NULL; /* XXX gcc4 */
243 1.39 mrg efp = NULL; /* XXX gcc4 */
244 1.8 christos #endif
245 1.1 jtc
246 1.1 jtc if (hist == NULL)
247 1.1 jtc error("history not active");
248 1.10 christos
249 1.1 jtc if (argc == 1)
250 1.1 jtc error("missing history argument");
251 1.1 jtc
252 1.1 jtc optreset = 1; optind = 1; /* initialize getopt */
253 1.1 jtc while (not_fcnumber(argv[optind]) &&
254 1.15 lukem (ch = getopt(argc, argv, ":e:lnrs")) != -1)
255 1.1 jtc switch ((char)ch) {
256 1.1 jtc case 'e':
257 1.25 christos editor = optionarg;
258 1.1 jtc break;
259 1.1 jtc case 'l':
260 1.1 jtc lflg = 1;
261 1.1 jtc break;
262 1.1 jtc case 'n':
263 1.1 jtc nflg = 1;
264 1.1 jtc break;
265 1.1 jtc case 'r':
266 1.1 jtc rflg = 1;
267 1.1 jtc break;
268 1.1 jtc case 's':
269 1.1 jtc sflg = 1;
270 1.1 jtc break;
271 1.1 jtc case ':':
272 1.1 jtc error("option -%c expects argument", optopt);
273 1.20 mycroft /* NOTREACHED */
274 1.1 jtc case '?':
275 1.1 jtc default:
276 1.1 jtc error("unknown option: -%c", optopt);
277 1.20 mycroft /* NOTREACHED */
278 1.1 jtc }
279 1.1 jtc argc -= optind, argv += optind;
280 1.1 jtc
281 1.1 jtc /*
282 1.1 jtc * If executing...
283 1.1 jtc */
284 1.1 jtc if (lflg == 0 || editor || sflg) {
285 1.1 jtc lflg = 0; /* ignore */
286 1.1 jtc editfile[0] = '\0';
287 1.1 jtc /*
288 1.1 jtc * Catch interrupts to reset active counter and
289 1.1 jtc * cleanup temp files.
290 1.1 jtc */
291 1.44 joerg savehandler = handler;
292 1.1 jtc if (setjmp(jmploc.loc)) {
293 1.1 jtc active = 0;
294 1.1 jtc if (*editfile)
295 1.1 jtc unlink(editfile);
296 1.1 jtc handler = savehandler;
297 1.1 jtc longjmp(handler->loc, 1);
298 1.1 jtc }
299 1.1 jtc handler = &jmploc;
300 1.1 jtc if (++active > MAXHISTLOOPS) {
301 1.1 jtc active = 0;
302 1.1 jtc displayhist = 0;
303 1.1 jtc error("called recursively too many times");
304 1.1 jtc }
305 1.1 jtc /*
306 1.1 jtc * Set editor.
307 1.1 jtc */
308 1.1 jtc if (sflg == 0) {
309 1.1 jtc if (editor == NULL &&
310 1.1 jtc (editor = bltinlookup("FCEDIT", 1)) == NULL &&
311 1.1 jtc (editor = bltinlookup("EDITOR", 1)) == NULL)
312 1.1 jtc editor = DEFEDITOR;
313 1.1 jtc if (editor[0] == '-' && editor[1] == '\0') {
314 1.1 jtc sflg = 1; /* no edit */
315 1.1 jtc editor = NULL;
316 1.1 jtc }
317 1.1 jtc }
318 1.1 jtc }
319 1.1 jtc
320 1.1 jtc /*
321 1.1 jtc * If executing, parse [old=new] now
322 1.1 jtc */
323 1.10 christos if (lflg == 0 && argc > 0 &&
324 1.1 jtc ((repl = strchr(argv[0], '=')) != NULL)) {
325 1.1 jtc pat = argv[0];
326 1.1 jtc *repl++ = '\0';
327 1.1 jtc argc--, argv++;
328 1.1 jtc }
329 1.38 aymeric
330 1.38 aymeric /*
331 1.38 aymeric * If -s is specified, accept only one operand
332 1.38 aymeric */
333 1.38 aymeric if (sflg && argc >= 2)
334 1.38 aymeric error("too many args");
335 1.38 aymeric
336 1.1 jtc /*
337 1.1 jtc * determine [first] and [last]
338 1.1 jtc */
339 1.1 jtc switch (argc) {
340 1.1 jtc case 0:
341 1.1 jtc firststr = lflg ? "-16" : "-1";
342 1.1 jtc laststr = "-1";
343 1.1 jtc break;
344 1.1 jtc case 1:
345 1.1 jtc firststr = argv[0];
346 1.1 jtc laststr = lflg ? "-1" : argv[0];
347 1.1 jtc break;
348 1.1 jtc case 2:
349 1.1 jtc firststr = argv[0];
350 1.1 jtc laststr = argv[1];
351 1.1 jtc break;
352 1.1 jtc default:
353 1.1 jtc error("too many args");
354 1.20 mycroft /* NOTREACHED */
355 1.1 jtc }
356 1.1 jtc /*
357 1.1 jtc * Turn into event numbers.
358 1.1 jtc */
359 1.1 jtc first = str_to_event(firststr, 0);
360 1.1 jtc last = str_to_event(laststr, 1);
361 1.1 jtc
362 1.1 jtc if (rflg) {
363 1.1 jtc i = last;
364 1.1 jtc last = first;
365 1.1 jtc first = i;
366 1.1 jtc }
367 1.1 jtc /*
368 1.1 jtc * XXX - this should not depend on the event numbers
369 1.10 christos * always increasing. Add sequence numbers or offset
370 1.1 jtc * to the history element in next (diskbased) release.
371 1.1 jtc */
372 1.1 jtc direction = first < last ? H_PREV : H_NEXT;
373 1.1 jtc
374 1.1 jtc /*
375 1.1 jtc * If editing, grab a temp file.
376 1.1 jtc */
377 1.1 jtc if (editor) {
378 1.1 jtc int fd;
379 1.1 jtc INTOFF; /* easier */
380 1.30 itojun snprintf(editfile, sizeof(editfile), "%s_shXXXXXX", _PATH_TMP);
381 1.1 jtc if ((fd = mkstemp(editfile)) < 0)
382 1.1 jtc error("can't create temporary file %s", editfile);
383 1.1 jtc if ((efp = fdopen(fd, "w")) == NULL) {
384 1.1 jtc close(fd);
385 1.10 christos error("can't allocate stdio buffer for temp");
386 1.1 jtc }
387 1.1 jtc }
388 1.1 jtc
389 1.1 jtc /*
390 1.1 jtc * Loop through selected history events. If listing or executing,
391 1.1 jtc * do it now. Otherwise, put into temp file and call the editor
392 1.1 jtc * after.
393 1.1 jtc *
394 1.1 jtc * The history interface needs rethinking, as the following
395 1.1 jtc * convolutions will demonstrate.
396 1.1 jtc */
397 1.16 christos history(hist, &he, H_FIRST);
398 1.16 christos retval = history(hist, &he, H_NEXT_EVENT, first);
399 1.16 christos for (;retval != -1; retval = history(hist, &he, direction)) {
400 1.1 jtc if (lflg) {
401 1.1 jtc if (!nflg)
402 1.16 christos out1fmt("%5d ", he.num);
403 1.16 christos out1str(he.str);
404 1.1 jtc } else {
405 1.21 christos const char *s = pat ?
406 1.21 christos fc_replace(he.str, pat, repl) : he.str;
407 1.1 jtc
408 1.1 jtc if (sflg) {
409 1.1 jtc if (displayhist) {
410 1.1 jtc out2str(s);
411 1.1 jtc }
412 1.21 christos
413 1.22 christos evalstring(strcpy(stalloc(strlen(s) + 1), s), 0);
414 1.1 jtc if (displayhist && hist) {
415 1.1 jtc /*
416 1.10 christos * XXX what about recursive and
417 1.1 jtc * relative histnums.
418 1.1 jtc */
419 1.16 christos history(hist, &he, H_ENTER, s);
420 1.1 jtc }
421 1.38 aymeric
422 1.38 aymeric break;
423 1.1 jtc } else
424 1.1 jtc fputs(s, efp);
425 1.1 jtc }
426 1.1 jtc /*
427 1.16 christos * At end? (if we were to lose last, we'd sure be
428 1.1 jtc * messed up).
429 1.1 jtc */
430 1.16 christos if (he.num == last)
431 1.1 jtc break;
432 1.1 jtc }
433 1.1 jtc if (editor) {
434 1.1 jtc char *editcmd;
435 1.1 jtc
436 1.1 jtc fclose(efp);
437 1.1 jtc editcmd = stalloc(strlen(editor) + strlen(editfile) + 2);
438 1.1 jtc sprintf(editcmd, "%s %s", editor, editfile);
439 1.22 christos evalstring(editcmd, 0); /* XXX - should use no JC command */
440 1.1 jtc INTON;
441 1.1 jtc readcmdfile(editfile); /* XXX - should read back - quick tst */
442 1.1 jtc unlink(editfile);
443 1.1 jtc }
444 1.10 christos
445 1.1 jtc if (lflg == 0 && active > 0)
446 1.1 jtc --active;
447 1.1 jtc if (displayhist)
448 1.1 jtc displayhist = 0;
449 1.8 christos return 0;
450 1.1 jtc }
451 1.1 jtc
452 1.21 christos STATIC const char *
453 1.27 christos fc_replace(const char *s, char *p, char *r)
454 1.1 jtc {
455 1.1 jtc char *dest;
456 1.1 jtc int plen = strlen(p);
457 1.1 jtc
458 1.1 jtc STARTSTACKSTR(dest);
459 1.1 jtc while (*s) {
460 1.1 jtc if (*s == *p && strncmp(s, p, plen) == 0) {
461 1.1 jtc while (*r)
462 1.1 jtc STPUTC(*r++, dest);
463 1.1 jtc s += plen;
464 1.1 jtc *p = '\0'; /* so no more matches */
465 1.1 jtc } else
466 1.1 jtc STPUTC(*s++, dest);
467 1.1 jtc }
468 1.1 jtc STACKSTRNUL(dest);
469 1.1 jtc dest = grabstackstr(dest);
470 1.1 jtc
471 1.1 jtc return (dest);
472 1.1 jtc }
473 1.1 jtc
474 1.4 cgd int
475 1.27 christos not_fcnumber(char *s)
476 1.1 jtc {
477 1.7 christos if (s == NULL)
478 1.7 christos return 0;
479 1.1 jtc if (*s == '-')
480 1.1 jtc s++;
481 1.1 jtc return (!is_number(s));
482 1.1 jtc }
483 1.1 jtc
484 1.4 cgd int
485 1.27 christos str_to_event(const char *str, int last)
486 1.1 jtc {
487 1.16 christos HistEvent he;
488 1.21 christos const char *s = str;
489 1.1 jtc int relative = 0;
490 1.16 christos int i, retval;
491 1.1 jtc
492 1.16 christos retval = history(hist, &he, H_FIRST);
493 1.1 jtc switch (*s) {
494 1.1 jtc case '-':
495 1.1 jtc relative = 1;
496 1.1 jtc /*FALLTHROUGH*/
497 1.1 jtc case '+':
498 1.1 jtc s++;
499 1.1 jtc }
500 1.1 jtc if (is_number(s)) {
501 1.1 jtc i = atoi(s);
502 1.1 jtc if (relative) {
503 1.16 christos while (retval != -1 && i--) {
504 1.16 christos retval = history(hist, &he, H_NEXT);
505 1.1 jtc }
506 1.16 christos if (retval == -1)
507 1.16 christos retval = history(hist, &he, H_LAST);
508 1.1 jtc } else {
509 1.16 christos retval = history(hist, &he, H_NEXT_EVENT, i);
510 1.16 christos if (retval == -1) {
511 1.1 jtc /*
512 1.1 jtc * the notion of first and last is
513 1.1 jtc * backwards to that of the history package
514 1.1 jtc */
515 1.16 christos retval = history(hist, &he,
516 1.16 christos last ? H_FIRST : H_LAST);
517 1.1 jtc }
518 1.1 jtc }
519 1.16 christos if (retval == -1)
520 1.1 jtc error("history number %s not found (internal error)",
521 1.1 jtc str);
522 1.1 jtc } else {
523 1.1 jtc /*
524 1.10 christos * pattern
525 1.1 jtc */
526 1.16 christos retval = history(hist, &he, H_PREV_STR, str);
527 1.16 christos if (retval == -1)
528 1.1 jtc error("history pattern not found: %s", str);
529 1.1 jtc }
530 1.16 christos return (he.num);
531 1.1 jtc }
532 1.11 christos #else
533 1.11 christos int
534 1.27 christos histcmd(int argc, char **argv)
535 1.28 gmcgarry {
536 1.28 gmcgarry error("not compiled with history support");
537 1.28 gmcgarry /* NOTREACHED */
538 1.28 gmcgarry }
539 1.28 gmcgarry int
540 1.28 gmcgarry inputrc(int argc, char **argv)
541 1.11 christos {
542 1.11 christos error("not compiled with history support");
543 1.20 mycroft /* NOTREACHED */
544 1.11 christos }
545 1.11 christos #endif
546