2011-05-11 23:38:44 +00:00
|
|
|
/* isearch.c - incremental searching */
|
|
|
|
|
1999-04-16 01:34:55 +00:00
|
|
|
/* **************************************************************** */
|
|
|
|
/* */
|
|
|
|
/* I-Search and Searching */
|
|
|
|
/* */
|
|
|
|
/* **************************************************************** */
|
|
|
|
|
2011-05-11 23:38:44 +00:00
|
|
|
/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2011-05-11 23:38:44 +00:00
|
|
|
This file is part of the GNU Readline Library (Readline), a library
|
|
|
|
for reading lines of text with interactive input and history editing.
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2011-05-11 23:38:44 +00:00
|
|
|
Readline is free software: you can redistribute it and/or modify
|
1999-04-16 01:34:55 +00:00
|
|
|
it under the terms of the GNU General Public License as published by
|
2011-05-11 23:38:44 +00:00
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Readline is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Readline. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
1999-04-16 01:34:55 +00:00
|
|
|
#define READLINE_LIBRARY
|
|
|
|
|
|
|
|
#if defined (HAVE_CONFIG_H)
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#if defined (HAVE_UNISTD_H)
|
|
|
|
# include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined (HAVE_STDLIB_H)
|
|
|
|
# include <stdlib.h>
|
|
|
|
#else
|
|
|
|
# include "ansi_stdlib.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "rldefs.h"
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
#include "rlmbutil.h"
|
|
|
|
|
1999-04-16 01:34:55 +00:00
|
|
|
#include "readline.h"
|
|
|
|
#include "history.h"
|
|
|
|
|
readline:
2000-07-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Import of readline 4.1.
Locally modified files: Makefile.in, configure.in, configure
(regenerated), config.h.in (regenerated), readline.h, rltty.c,
shell.c signals.c.
Locally added files: acconfig.h, config/*, config.h.bot,
cross-build/*, doc/inc-hit.texinfo.
New files: USAGE, rlprivate.h, rlshell.h, xmalloc.h.
examples:
2000-07-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Import of readline 4.1.
New files: excallback.c, rlfe.c.
doc:
2000-07-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Import of readline 4.1.
Regenerated inc-hist.texinfo as copy of hsuser.texinfo, for
inclusion in the gdb manual.
New file: rluserman.texinfo
2000-07-09 17:20:00 +00:00
|
|
|
#include "rlprivate.h"
|
|
|
|
#include "xmalloc.h"
|
|
|
|
|
1999-08-02 23:48:02 +00:00
|
|
|
/* Variables exported to other files in the readline library. */
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
char *_rl_isearch_terminators = (char *)NULL;
|
1999-08-02 23:48:02 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
_rl_search_cxt *_rl_iscxt = 0;
|
|
|
|
|
1999-04-16 01:34:55 +00:00
|
|
|
/* Variables imported from other files in the readline library. */
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
extern HIST_ENTRY *_rl_saved_line_for_history;
|
1999-04-16 01:34:55 +00:00
|
|
|
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
static int rl_search_history PARAMS((int, int));
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
static _rl_search_cxt *_rl_isearch_init PARAMS((int));
|
|
|
|
static void _rl_isearch_fini PARAMS((_rl_search_cxt *));
|
|
|
|
static int _rl_isearch_cleanup PARAMS((_rl_search_cxt *, int));
|
|
|
|
|
1999-04-16 01:34:55 +00:00
|
|
|
/* Last line found by the current incremental search, so we don't `find'
|
2011-05-11 23:38:44 +00:00
|
|
|
identical lines many times in a row. Now part of isearch context. */
|
|
|
|
/* static char *prev_line_found; */
|
1999-04-16 01:34:55 +00:00
|
|
|
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
/* Last search string and its length. */
|
|
|
|
static char *last_isearch_string;
|
|
|
|
static int last_isearch_string_len;
|
|
|
|
|
2011-05-11 23:38:44 +00:00
|
|
|
static char * const default_isearch_terminators = "\033\012";
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
_rl_search_cxt *
|
|
|
|
_rl_scxt_alloc (type, flags)
|
|
|
|
int type, flags;
|
|
|
|
{
|
|
|
|
_rl_search_cxt *cxt;
|
|
|
|
|
|
|
|
cxt = (_rl_search_cxt *)xmalloc (sizeof (_rl_search_cxt));
|
|
|
|
|
|
|
|
cxt->type = type;
|
|
|
|
cxt->sflags = flags;
|
|
|
|
|
|
|
|
cxt->search_string = 0;
|
|
|
|
cxt->search_string_size = cxt->search_string_index = 0;
|
|
|
|
|
|
|
|
cxt->lines = 0;
|
|
|
|
cxt->allocated_line = 0;
|
|
|
|
cxt->hlen = cxt->hindex = 0;
|
|
|
|
|
|
|
|
cxt->save_point = rl_point;
|
|
|
|
cxt->save_mark = rl_mark;
|
|
|
|
cxt->save_line = where_history ();
|
|
|
|
cxt->last_found_line = cxt->save_line;
|
|
|
|
cxt->prev_line_found = 0;
|
|
|
|
|
|
|
|
cxt->save_undo_list = 0;
|
|
|
|
|
2011-05-11 23:38:44 +00:00
|
|
|
cxt->keymap = _rl_keymap;
|
|
|
|
cxt->okeymap = _rl_keymap;
|
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->history_pos = 0;
|
|
|
|
cxt->direction = 0;
|
|
|
|
|
|
|
|
cxt->lastc = 0;
|
|
|
|
|
|
|
|
cxt->sline = 0;
|
|
|
|
cxt->sline_len = cxt->sline_index = 0;
|
|
|
|
|
|
|
|
cxt->search_terminators = 0;
|
|
|
|
|
|
|
|
return cxt;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_rl_scxt_dispose (cxt, flags)
|
|
|
|
_rl_search_cxt *cxt;
|
|
|
|
int flags;
|
|
|
|
{
|
|
|
|
FREE (cxt->search_string);
|
|
|
|
FREE (cxt->allocated_line);
|
|
|
|
FREE (cxt->lines);
|
|
|
|
|
2011-05-11 23:38:44 +00:00
|
|
|
xfree (cxt);
|
2006-05-05 18:26:14 +00:00
|
|
|
}
|
|
|
|
|
1999-04-16 01:34:55 +00:00
|
|
|
/* Search backwards through the history looking for a string which is typed
|
|
|
|
interactively. Start with the current line. */
|
|
|
|
int
|
|
|
|
rl_reverse_search_history (sign, key)
|
|
|
|
int sign, key;
|
|
|
|
{
|
|
|
|
return (rl_search_history (-sign, key));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Search forwards through the history looking for a string which is typed
|
|
|
|
interactively. Start with the current line. */
|
|
|
|
int
|
|
|
|
rl_forward_search_history (sign, key)
|
|
|
|
int sign, key;
|
|
|
|
{
|
|
|
|
return (rl_search_history (sign, key));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Display the current state of the search in the echo-area.
|
|
|
|
SEARCH_STRING contains the string that is being searched for,
|
2006-05-05 18:26:14 +00:00
|
|
|
DIRECTION is zero for forward, or non-zero for reverse,
|
1999-04-16 01:34:55 +00:00
|
|
|
WHERE is the history list number of the current line. If it is
|
|
|
|
-1, then this line is the starting one. */
|
|
|
|
static void
|
|
|
|
rl_display_search (search_string, reverse_p, where)
|
|
|
|
char *search_string;
|
|
|
|
int reverse_p, where;
|
|
|
|
{
|
|
|
|
char *message;
|
|
|
|
int msglen, searchlen;
|
|
|
|
|
|
|
|
searchlen = (search_string && *search_string) ? strlen (search_string) : 0;
|
|
|
|
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
message = (char *)xmalloc (searchlen + 33);
|
1999-04-16 01:34:55 +00:00
|
|
|
msglen = 0;
|
|
|
|
|
|
|
|
#if defined (NOTDEF)
|
|
|
|
if (where != -1)
|
|
|
|
{
|
|
|
|
sprintf (message, "[%d]", where + history_base);
|
|
|
|
msglen = strlen (message);
|
|
|
|
}
|
|
|
|
#endif /* NOTDEF */
|
|
|
|
|
|
|
|
message[msglen++] = '(';
|
|
|
|
|
|
|
|
if (reverse_p)
|
|
|
|
{
|
|
|
|
strcpy (message + msglen, "reverse-");
|
|
|
|
msglen += 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
strcpy (message + msglen, "i-search)`");
|
|
|
|
msglen += 10;
|
|
|
|
|
|
|
|
if (search_string)
|
|
|
|
{
|
|
|
|
strcpy (message + msglen, search_string);
|
|
|
|
msglen += searchlen;
|
|
|
|
}
|
|
|
|
|
|
|
|
strcpy (message + msglen, "': ");
|
|
|
|
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
rl_message ("%s", message);
|
2011-05-11 23:38:44 +00:00
|
|
|
xfree (message);
|
1999-04-16 01:34:55 +00:00
|
|
|
(*rl_redisplay_function) ();
|
|
|
|
}
|
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
static _rl_search_cxt *
|
|
|
|
_rl_isearch_init (direction)
|
|
|
|
int direction;
|
1999-04-16 01:34:55 +00:00
|
|
|
{
|
2006-05-05 18:26:14 +00:00
|
|
|
_rl_search_cxt *cxt;
|
1999-04-16 01:34:55 +00:00
|
|
|
register int i;
|
2006-05-05 18:26:14 +00:00
|
|
|
HIST_ENTRY **hlist;
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt = _rl_scxt_alloc (RL_SEARCH_ISEARCH, 0);
|
|
|
|
if (direction < 0)
|
|
|
|
cxt->sflags |= SF_REVERSE;
|
1999-08-02 23:48:02 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->search_terminators = _rl_isearch_terminators ? _rl_isearch_terminators
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
: default_isearch_terminators;
|
1999-08-02 23:48:02 +00:00
|
|
|
|
1999-04-16 01:34:55 +00:00
|
|
|
/* Create an arrary of pointers to the lines that we want to search. */
|
2006-05-05 18:26:14 +00:00
|
|
|
hlist = history_list ();
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
rl_maybe_replace_line ();
|
1999-04-16 01:34:55 +00:00
|
|
|
i = 0;
|
|
|
|
if (hlist)
|
|
|
|
for (i = 0; hlist[i]; i++);
|
|
|
|
|
|
|
|
/* Allocate space for this many lines, +1 for the current input line,
|
|
|
|
and remember those lines. */
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->lines = (char **)xmalloc ((1 + (cxt->hlen = i)) * sizeof (char *));
|
|
|
|
for (i = 0; i < cxt->hlen; i++)
|
|
|
|
cxt->lines[i] = hlist[i]->line;
|
1999-04-16 01:34:55 +00:00
|
|
|
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
if (_rl_saved_line_for_history)
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->lines[i] = _rl_saved_line_for_history->line;
|
1999-04-16 01:34:55 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Keep track of this so we can free it. */
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->allocated_line = (char *)xmalloc (1 + strlen (rl_line_buffer));
|
|
|
|
strcpy (cxt->allocated_line, &rl_line_buffer[0]);
|
|
|
|
cxt->lines[i] = cxt->allocated_line;
|
1999-04-16 01:34:55 +00:00
|
|
|
}
|
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->hlen++;
|
1999-04-16 01:34:55 +00:00
|
|
|
|
|
|
|
/* The line where we start the search. */
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->history_pos = cxt->save_line;
|
1999-04-16 01:34:55 +00:00
|
|
|
|
1999-08-02 23:48:02 +00:00
|
|
|
rl_save_prompt ();
|
1999-04-16 01:34:55 +00:00
|
|
|
|
|
|
|
/* Initialize search parameters. */
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->search_string = (char *)xmalloc (cxt->search_string_size = 128);
|
|
|
|
cxt->search_string[cxt->search_string_index = 0] = '\0';
|
1999-04-16 01:34:55 +00:00
|
|
|
|
|
|
|
/* Normalize DIRECTION into 1 or -1. */
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->direction = (direction >= 0) ? 1 : -1;
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->sline = rl_line_buffer;
|
|
|
|
cxt->sline_len = strlen (cxt->sline);
|
|
|
|
cxt->sline_index = rl_point;
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
_rl_iscxt = cxt; /* save globally */
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
return cxt;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_rl_isearch_fini (cxt)
|
|
|
|
_rl_search_cxt *cxt;
|
|
|
|
{
|
|
|
|
/* First put back the original state. */
|
|
|
|
strcpy (rl_line_buffer, cxt->lines[cxt->save_line]);
|
|
|
|
|
|
|
|
rl_restore_prompt ();
|
|
|
|
|
|
|
|
/* Save the search string for possible later use. */
|
|
|
|
FREE (last_isearch_string);
|
|
|
|
last_isearch_string = cxt->search_string;
|
|
|
|
last_isearch_string_len = cxt->search_string_index;
|
|
|
|
cxt->search_string = 0;
|
|
|
|
|
|
|
|
if (cxt->last_found_line < cxt->save_line)
|
|
|
|
rl_get_previous_history (cxt->save_line - cxt->last_found_line, 0);
|
|
|
|
else
|
|
|
|
rl_get_next_history (cxt->last_found_line - cxt->save_line, 0);
|
|
|
|
|
|
|
|
/* If the string was not found, put point at the end of the last matching
|
|
|
|
line. If last_found_line == orig_line, we didn't find any matching
|
|
|
|
history lines at all, so put point back in its original position. */
|
|
|
|
if (cxt->sline_index < 0)
|
1999-04-16 01:34:55 +00:00
|
|
|
{
|
2006-05-05 18:26:14 +00:00
|
|
|
if (cxt->last_found_line == cxt->save_line)
|
|
|
|
cxt->sline_index = cxt->save_point;
|
|
|
|
else
|
|
|
|
cxt->sline_index = strlen (rl_line_buffer);
|
|
|
|
rl_mark = cxt->save_mark;
|
|
|
|
}
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
rl_point = cxt->sline_index;
|
|
|
|
/* Don't worry about where to put the mark here; rl_get_previous_history
|
|
|
|
and rl_get_next_history take care of it. */
|
|
|
|
|
|
|
|
rl_clear_message ();
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
_rl_search_getchar (cxt)
|
|
|
|
_rl_search_cxt *cxt;
|
|
|
|
{
|
|
|
|
int c;
|
|
|
|
|
|
|
|
/* Read a key and decide how to proceed. */
|
|
|
|
RL_SETSTATE(RL_STATE_MOREINPUT);
|
|
|
|
c = cxt->lastc = rl_read_key ();
|
|
|
|
RL_UNSETSTATE(RL_STATE_MOREINPUT);
|
1999-04-16 01:34:55 +00:00
|
|
|
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
#if defined (HANDLE_MULTIBYTE)
|
2006-05-05 18:26:14 +00:00
|
|
|
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
|
|
|
c = cxt->lastc = _rl_read_mbstring (cxt->lastc, cxt->mb, MB_LEN_MAX);
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
#endif
|
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
return c;
|
|
|
|
}
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
/* Process just-read character C according to isearch context CXT. Return
|
|
|
|
-1 if the caller should just free the context and return, 0 if we should
|
|
|
|
break out of the loop, and 1 if we should continue to read characters. */
|
|
|
|
int
|
|
|
|
_rl_isearch_dispatch (cxt, c)
|
|
|
|
_rl_search_cxt *cxt;
|
|
|
|
int c;
|
|
|
|
{
|
|
|
|
int n, wstart, wlen, limit, cval;
|
|
|
|
rl_command_func_t *f;
|
|
|
|
|
|
|
|
f = (rl_command_func_t *)NULL;
|
2011-05-11 23:38:44 +00:00
|
|
|
|
|
|
|
if (c < 0)
|
2006-05-05 18:26:14 +00:00
|
|
|
{
|
2011-05-11 23:38:44 +00:00
|
|
|
cxt->sflags |= SF_FAILED;
|
|
|
|
cxt->history_pos = cxt->last_found_line;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If we are moving into a new keymap, modify cxt->keymap and go on.
|
|
|
|
This can be a problem if c == ESC and we want to terminate the
|
|
|
|
incremental search, so we check */
|
|
|
|
if (c >= 0 && cxt->keymap[c].type == ISKMAP && strchr (cxt->search_terminators, cxt->lastc) == 0)
|
|
|
|
{
|
|
|
|
cxt->keymap = FUNCTION_TO_KEYMAP (cxt->keymap, c);
|
|
|
|
cxt->sflags |= SF_CHGKMAP;
|
|
|
|
/* XXX - we should probably save this sequence, so we can do
|
|
|
|
something useful if this doesn't end up mapping to a command. */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Translate the keys we do something with to opcodes. */
|
|
|
|
if (c >= 0 && cxt->keymap[c].type == ISFUNC)
|
|
|
|
{
|
|
|
|
f = cxt->keymap[c].function;
|
2006-05-05 18:26:14 +00:00
|
|
|
|
|
|
|
if (f == rl_reverse_search_history)
|
|
|
|
cxt->lastc = (cxt->sflags & SF_REVERSE) ? -1 : -2;
|
|
|
|
else if (f == rl_forward_search_history)
|
|
|
|
cxt->lastc = (cxt->sflags & SF_REVERSE) ? -2 : -1;
|
|
|
|
else if (f == rl_rubout)
|
|
|
|
cxt->lastc = -3;
|
2011-05-11 23:38:44 +00:00
|
|
|
else if (c == CTRL ('G') || f == rl_abort)
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->lastc = -4;
|
2011-05-11 23:38:44 +00:00
|
|
|
else if (c == CTRL ('W') || f == rl_unix_word_rubout) /* XXX */
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->lastc = -5;
|
2011-05-11 23:38:44 +00:00
|
|
|
else if (c == CTRL ('Y') || f == rl_yank) /* XXX */
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->lastc = -6;
|
|
|
|
}
|
|
|
|
|
2011-05-11 23:38:44 +00:00
|
|
|
/* If we changed the keymap earlier while translating a key sequence into
|
|
|
|
a command, restore it now that we've succeeded. */
|
|
|
|
if (cxt->sflags & SF_CHGKMAP)
|
|
|
|
{
|
|
|
|
cxt->keymap = cxt->okeymap;
|
|
|
|
cxt->sflags &= ~SF_CHGKMAP;
|
|
|
|
}
|
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
/* The characters in isearch_terminators (set from the user-settable
|
|
|
|
variable isearch-terminators) are used to terminate the search but
|
|
|
|
not subsequently execute the character as a command. The default
|
|
|
|
value is "\033\012" (ESC and C-J). */
|
2011-05-11 23:38:44 +00:00
|
|
|
if (cxt->lastc > 0 && strchr (cxt->search_terminators, cxt->lastc))
|
2006-05-05 18:26:14 +00:00
|
|
|
{
|
|
|
|
/* ESC still terminates the search, but if there is pending
|
|
|
|
input or if input arrives within 0.1 seconds (on systems
|
|
|
|
with select(2)) it is used as a prefix character
|
|
|
|
with rl_execute_next. WATCH OUT FOR THIS! This is intended
|
|
|
|
to allow the arrow keys to be used like ^F and ^B are used
|
|
|
|
to terminate the search and execute the movement command.
|
|
|
|
XXX - since _rl_input_available depends on the application-
|
|
|
|
settable keyboard timeout value, this could alternatively
|
|
|
|
use _rl_input_queued(100000) */
|
|
|
|
if (cxt->lastc == ESC && _rl_input_available ())
|
|
|
|
rl_execute_next (ESC);
|
|
|
|
return (0);
|
|
|
|
}
|
1999-04-16 01:34:55 +00:00
|
|
|
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
#define ENDSRCH_CHAR(c) \
|
|
|
|
((CTRL_CHAR (c) || META_CHAR (c) || (c) == RUBOUT) && ((c) != CTRL ('G')))
|
|
|
|
|
|
|
|
#if defined (HANDLE_MULTIBYTE)
|
2006-05-05 18:26:14 +00:00
|
|
|
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
|
|
|
{
|
|
|
|
if (cxt->lastc >= 0 && (cxt->mb[0] && cxt->mb[1] == '\0') && ENDSRCH_CHAR (cxt->lastc))
|
|
|
|
{
|
2011-05-11 23:38:44 +00:00
|
|
|
/* This sets rl_pending_input to LASTC; it will be picked up the next
|
2006-05-05 18:26:14 +00:00
|
|
|
time rl_read_key is called. */
|
|
|
|
rl_execute_next (cxt->lastc);
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
if (cxt->lastc >= 0 && ENDSRCH_CHAR (cxt->lastc))
|
|
|
|
{
|
|
|
|
/* This sets rl_pending_input to LASTC; it will be picked up the next
|
|
|
|
time rl_read_key is called. */
|
|
|
|
rl_execute_next (cxt->lastc);
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Now dispatch on the character. `Opcodes' affect the search string or
|
|
|
|
state. Other characters are added to the string. */
|
|
|
|
switch (cxt->lastc)
|
|
|
|
{
|
|
|
|
/* search again */
|
|
|
|
case -1:
|
|
|
|
if (cxt->search_string_index == 0)
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
{
|
2006-05-05 18:26:14 +00:00
|
|
|
if (last_isearch_string)
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
{
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->search_string_size = 64 + last_isearch_string_len;
|
|
|
|
cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size);
|
|
|
|
strcpy (cxt->search_string, last_isearch_string);
|
|
|
|
cxt->search_string_index = last_isearch_string_len;
|
|
|
|
rl_display_search (cxt->search_string, (cxt->sflags & SF_REVERSE), -1);
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-05-05 18:26:14 +00:00
|
|
|
return (1);
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
}
|
2006-05-05 18:26:14 +00:00
|
|
|
else if (cxt->sflags & SF_REVERSE)
|
|
|
|
cxt->sline_index--;
|
|
|
|
else if (cxt->sline_index != cxt->sline_len)
|
|
|
|
cxt->sline_index++;
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
else
|
2006-05-05 18:26:14 +00:00
|
|
|
rl_ding ();
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* switch directions */
|
|
|
|
case -2:
|
|
|
|
cxt->direction = -cxt->direction;
|
|
|
|
if (cxt->direction < 0)
|
|
|
|
cxt->sflags |= SF_REVERSE;
|
|
|
|
else
|
|
|
|
cxt->sflags &= ~SF_REVERSE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* delete character from search string. */
|
|
|
|
case -3: /* C-H, DEL */
|
|
|
|
/* This is tricky. To do this right, we need to keep a
|
|
|
|
stack of search positions for the current search, with
|
|
|
|
sentinels marking the beginning and end. But this will
|
|
|
|
do until we have a real isearch-undo. */
|
|
|
|
if (cxt->search_string_index == 0)
|
|
|
|
rl_ding ();
|
|
|
|
else
|
|
|
|
cxt->search_string[--cxt->search_string_index] = '\0';
|
|
|
|
break;
|
|
|
|
|
|
|
|
case -4: /* C-G, abort */
|
|
|
|
rl_replace_line (cxt->lines[cxt->save_line], 0);
|
|
|
|
rl_point = cxt->save_point;
|
|
|
|
rl_mark = cxt->save_mark;
|
|
|
|
rl_restore_prompt();
|
|
|
|
rl_clear_message ();
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
case -5: /* C-W */
|
|
|
|
/* skip over portion of line we already matched and yank word */
|
|
|
|
wstart = rl_point + cxt->search_string_index;
|
|
|
|
if (wstart >= rl_end)
|
1999-04-16 01:34:55 +00:00
|
|
|
{
|
2006-05-05 18:26:14 +00:00
|
|
|
rl_ding ();
|
1999-04-16 01:34:55 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
/* if not in a word, move to one. */
|
|
|
|
cval = _rl_char_value (rl_line_buffer, wstart);
|
|
|
|
if (_rl_walphabetic (cval) == 0)
|
1999-04-16 01:34:55 +00:00
|
|
|
{
|
2006-05-05 18:26:14 +00:00
|
|
|
rl_ding ();
|
1999-04-16 01:34:55 +00:00
|
|
|
break;
|
2006-05-05 18:26:14 +00:00
|
|
|
}
|
|
|
|
n = MB_NEXTCHAR (rl_line_buffer, wstart, 1, MB_FIND_NONZERO);;
|
|
|
|
while (n < rl_end)
|
|
|
|
{
|
|
|
|
cval = _rl_char_value (rl_line_buffer, n);
|
|
|
|
if (_rl_walphabetic (cval) == 0)
|
|
|
|
break;
|
|
|
|
n = MB_NEXTCHAR (rl_line_buffer, n, 1, MB_FIND_NONZERO);;
|
|
|
|
}
|
|
|
|
wlen = n - wstart + 1;
|
|
|
|
if (cxt->search_string_index + wlen + 1 >= cxt->search_string_size)
|
|
|
|
{
|
|
|
|
cxt->search_string_size += wlen + 1;
|
|
|
|
cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size);
|
|
|
|
}
|
|
|
|
for (; wstart < n; wstart++)
|
|
|
|
cxt->search_string[cxt->search_string_index++] = rl_line_buffer[wstart];
|
|
|
|
cxt->search_string[cxt->search_string_index] = '\0';
|
|
|
|
break;
|
|
|
|
|
|
|
|
case -6: /* C-Y */
|
|
|
|
/* skip over portion of line we already matched and yank rest */
|
|
|
|
wstart = rl_point + cxt->search_string_index;
|
|
|
|
if (wstart >= rl_end)
|
|
|
|
{
|
|
|
|
rl_ding ();
|
1999-04-16 01:34:55 +00:00
|
|
|
break;
|
2006-05-05 18:26:14 +00:00
|
|
|
}
|
|
|
|
n = rl_end - wstart + 1;
|
|
|
|
if (cxt->search_string_index + n + 1 >= cxt->search_string_size)
|
|
|
|
{
|
|
|
|
cxt->search_string_size += n + 1;
|
|
|
|
cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size);
|
|
|
|
}
|
|
|
|
for (n = wstart; n < rl_end; n++)
|
|
|
|
cxt->search_string[cxt->search_string_index++] = rl_line_buffer[n];
|
|
|
|
cxt->search_string[cxt->search_string_index] = '\0';
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Add character to search string and continue search. */
|
|
|
|
default:
|
|
|
|
if (cxt->search_string_index + 2 >= cxt->search_string_size)
|
|
|
|
{
|
|
|
|
cxt->search_string_size += 128;
|
|
|
|
cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size);
|
|
|
|
}
|
|
|
|
#if defined (HANDLE_MULTIBYTE)
|
|
|
|
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
|
|
|
{
|
|
|
|
int j, l;
|
|
|
|
for (j = 0, l = strlen (cxt->mb); j < l; )
|
|
|
|
cxt->search_string[cxt->search_string_index++] = cxt->mb[j++];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
cxt->search_string[cxt->search_string_index++] = c;
|
|
|
|
cxt->search_string[cxt->search_string_index] = '\0';
|
|
|
|
break;
|
|
|
|
}
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
for (cxt->sflags &= ~(SF_FOUND|SF_FAILED);; )
|
|
|
|
{
|
|
|
|
limit = cxt->sline_len - cxt->search_string_index + 1;
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
/* Search the current line. */
|
|
|
|
while ((cxt->sflags & SF_REVERSE) ? (cxt->sline_index >= 0) : (cxt->sline_index < limit))
|
|
|
|
{
|
|
|
|
if (STREQN (cxt->search_string, cxt->sline + cxt->sline_index, cxt->search_string_index))
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
{
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->sflags |= SF_FOUND;
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-05-05 18:26:14 +00:00
|
|
|
else
|
|
|
|
cxt->sline_index += cxt->direction;
|
|
|
|
}
|
|
|
|
if (cxt->sflags & SF_FOUND)
|
|
|
|
break;
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
/* Move to the next line, but skip new copies of the line
|
|
|
|
we just found and lines shorter than the string we're
|
|
|
|
searching for. */
|
|
|
|
do
|
|
|
|
{
|
|
|
|
/* Move to the next line. */
|
|
|
|
cxt->history_pos += cxt->direction;
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
/* At limit for direction? */
|
|
|
|
if ((cxt->sflags & SF_REVERSE) ? (cxt->history_pos < 0) : (cxt->history_pos == cxt->hlen))
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
{
|
2006-05-05 18:26:14 +00:00
|
|
|
cxt->sflags |= SF_FAILED;
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
break;
|
|
|
|
}
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
/* We will need these later. */
|
|
|
|
cxt->sline = cxt->lines[cxt->history_pos];
|
|
|
|
cxt->sline_len = strlen (cxt->sline);
|
1999-04-16 01:34:55 +00:00
|
|
|
}
|
2006-05-05 18:26:14 +00:00
|
|
|
while ((cxt->prev_line_found && STREQ (cxt->prev_line_found, cxt->lines[cxt->history_pos])) ||
|
|
|
|
(cxt->search_string_index > cxt->sline_len));
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
if (cxt->sflags & SF_FAILED)
|
|
|
|
break;
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
/* Now set up the line for searching... */
|
|
|
|
cxt->sline_index = (cxt->sflags & SF_REVERSE) ? cxt->sline_len - cxt->search_string_index : 0;
|
|
|
|
}
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
if (cxt->sflags & SF_FAILED)
|
|
|
|
{
|
|
|
|
/* We cannot find the search string. Ding the bell. */
|
|
|
|
rl_ding ();
|
|
|
|
cxt->history_pos = cxt->last_found_line;
|
|
|
|
return 1;
|
|
|
|
}
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
/* We have found the search string. Just display it. But don't
|
|
|
|
actually move there in the history list until the user accepts
|
|
|
|
the location. */
|
|
|
|
if (cxt->sflags & SF_FOUND)
|
|
|
|
{
|
|
|
|
cxt->prev_line_found = cxt->lines[cxt->history_pos];
|
|
|
|
rl_replace_line (cxt->lines[cxt->history_pos], 0);
|
|
|
|
rl_point = cxt->sline_index;
|
|
|
|
cxt->last_found_line = cxt->history_pos;
|
|
|
|
rl_display_search (cxt->search_string, (cxt->sflags & SF_REVERSE), (cxt->history_pos == cxt->save_line) ? -1 : cxt->history_pos);
|
|
|
|
}
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
return 1;
|
|
|
|
}
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
static int
|
|
|
|
_rl_isearch_cleanup (cxt, r)
|
|
|
|
_rl_search_cxt *cxt;
|
|
|
|
int r;
|
|
|
|
{
|
|
|
|
if (r >= 0)
|
|
|
|
_rl_isearch_fini (cxt);
|
|
|
|
_rl_scxt_dispose (cxt, 0);
|
|
|
|
_rl_iscxt = 0;
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
RL_UNSETSTATE(RL_STATE_ISEARCH);
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
return (r != 0);
|
|
|
|
}
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
/* Search through the history looking for an interactively typed string.
|
|
|
|
This is analogous to i-search. We start the search in the current line.
|
|
|
|
DIRECTION is which direction to search; >= 0 means forward, < 0 means
|
|
|
|
backwards. */
|
|
|
|
static int
|
|
|
|
rl_search_history (direction, invoking_key)
|
|
|
|
int direction, invoking_key;
|
|
|
|
{
|
|
|
|
_rl_search_cxt *cxt; /* local for now, but saved globally */
|
|
|
|
int c, r;
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
RL_SETSTATE(RL_STATE_ISEARCH);
|
|
|
|
cxt = _rl_isearch_init (direction);
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
rl_display_search (cxt->search_string, (cxt->sflags & SF_REVERSE), -1);
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
/* If we are using the callback interface, all we do is set up here and
|
|
|
|
return. The key is that we leave RL_STATE_ISEARCH set. */
|
|
|
|
if (RL_ISSTATE (RL_STATE_CALLBACK))
|
|
|
|
return (0);
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
r = -1;
|
|
|
|
for (;;)
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
{
|
2006-05-05 18:26:14 +00:00
|
|
|
c = _rl_search_getchar (cxt);
|
|
|
|
/* We might want to handle EOF here (c == 0) */
|
|
|
|
r = _rl_isearch_dispatch (cxt, cxt->lastc);
|
|
|
|
if (r <= 0)
|
|
|
|
break;
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
}
|
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
/* The searching is over. The user may have found the string that she
|
|
|
|
was looking for, or else she may have exited a failing search. If
|
|
|
|
LINE_INDEX is -1, then that shows that the string searched for was
|
|
|
|
not found. We use this to determine where to place rl_point. */
|
|
|
|
return (_rl_isearch_cleanup (cxt, r));
|
|
|
|
}
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
#if defined (READLINE_CALLBACKS)
|
|
|
|
/* Called from the callback functions when we are ready to read a key. The
|
|
|
|
callback functions know to call this because RL_ISSTATE(RL_STATE_ISEARCH).
|
|
|
|
If _rl_isearch_dispatch finishes searching, this function is responsible
|
|
|
|
for turning off RL_STATE_ISEARCH, which it does using _rl_isearch_cleanup. */
|
|
|
|
int
|
|
|
|
_rl_isearch_callback (cxt)
|
|
|
|
_rl_search_cxt *cxt;
|
|
|
|
{
|
|
|
|
int c, r;
|
1999-04-16 01:34:55 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
c = _rl_search_getchar (cxt);
|
|
|
|
/* We might want to handle EOF here */
|
|
|
|
r = _rl_isearch_dispatch (cxt, cxt->lastc);
|
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
2002-12-08 22:31:39 +00:00
|
|
|
|
2006-05-05 18:26:14 +00:00
|
|
|
return (r <= 0) ? _rl_isearch_cleanup (cxt, r) : 0;
|
1999-04-16 01:34:55 +00:00
|
|
|
}
|
2006-05-05 18:26:14 +00:00
|
|
|
#endif
|