Commit Graph

69 Commits

Author SHA1 Message Date
christos
f1fff5b02e Change to a 3 clause copyright after permission of the holders. 2006-08-21 12:45:30 +00:00
christos
213f1e2476 PR/34062: Tanaka Akira: rl_deprep_term_function is NULL in libedit.
Default to rl_deprep_terminal as suggested; do the same for
rl_prep_term_function
2006-07-23 20:21:45 +00:00
rtr
596eb336c9 remove if/free block checking known condition
coverity 2762 / run 11
2006-03-25 13:00:11 +00:00
christos
4baec30349 Coverity CID 2743: Not really a memory leak, but make it obvious that we
always free tmp.
2006-03-21 17:52:50 +00:00
christos
5900226fad Lint comment. 2006-03-18 19:22:59 +00:00
christos
c66ab9a1d0 Coverity CID 1666: Plug memory leak. 2006-03-18 09:28:23 +00:00
christos
c5f39d86c2 Coverity CID 1667: Plug memory leak 2006-03-18 09:19:02 +00:00
christos
53c1263c37 Coverity CID 1662: Memory leak. 2006-03-18 09:15:57 +00:00
christos
0fd1bd6295 use the tty chars for reprint and eof instead of hard-coded ^R and ^D 2006-03-06 21:11:03 +00:00
christos
10f8fe2052 PR/32817: Magnus Svensson: write_history and read_history returncode is not
readline compatible.
2006-02-13 14:12:04 +00:00
christos
fd2c82a86e Partial rl_getc_function support from Jess Thrysoee. 2006-02-12 16:15:07 +00:00
christos
45542456a5 PR/30747: David N. Williams: libedit is missing remove_history()
Added, please test.
2005-07-14 15:00:58 +00:00
christos
19c38590ee PR/30500: Paul Shupak: Inconsistent definition of tilde_expand().
Provide a layer of indirection between the readline compatibility functions
and our internal implementation, so that we have the freedom to change the
function signature.
2005-06-11 18:18:59 +00:00
christos
3cfbfdb2ef Bug reported from Martin Dietze:
The place to change the completion_append_character is
    usually somewhere in the `rl_completion_entry_function'
    callback which is where one usually can distinguish between
    file- or dir-like entries to append a slash for dirs etc.

    This does no longer work since `fn_complete()' takes the
    `append_character' as argument before the callback is executed,
    so that changes to the variable `rl_completion_append_character'
    have in fact no effect for the current completion.

Fix by adding a function that returns the rl_completion_append_character,
when it gets passed in a filename in readline emulation.
2005-06-10 20:21:00 +00:00
agc
305f170238 Use the correct type for the stored callback function 2005-05-27 14:01:46 +00:00
agc
26abf58dee Sync the alternative readline interface with reality:
+ the rl_callback_handler_install takes a pointer to a void function
  which has one char * argument (it's called that way in the readline
  emulation source, otherwise there's no way to pass the line buffer
  to the function which processes the line when EOL is encountered)

+ provide a prototype for that function signature and use it

Makes the callback readline interface work now.
2005-05-27 11:35:07 +00:00
dsl
41a59814ed Separate out the filename completion functions from the readline() code.
Pass in loads of parameters instead of relying on shed-loads of global
variables to modify the behaviour.
The filename completion code can now be enabled by code that uses el_gets().
(eg /bin/sh)
2005-05-07 16:01:25 +00:00
christos
b9b92f846c check for pwd != NULL, fix a missed getpwnam. 2005-04-19 03:29:18 +00:00
christos
a76abbed58 PR/29958: Peter Bex: add rl_variable_bind and rl_attempted_completion_over 2005-04-12 22:01:40 +00:00
christos
bf7832efc6 use getpwent_r 2005-04-02 06:28:10 +00:00
christos
af62817ea3 Always update the position variables before the map function is called.
From Rob Rodgers, thanks!
2005-03-10 19:34:46 +00:00
christos
f96c72ee24 set UNBUFFERED again after you do the line callback so that the new line
gets refreshed.
2005-03-09 23:55:35 +00:00
christos
0d0ad08914 cut out the middle-man and use el_insertstr() directly. 2004-09-08 18:15:57 +00:00
christos
ac4e17d0c7 Better fix for rl_prep_terminal() from Gerry Swislow. 2004-02-27 14:52:18 +00:00
christos
c8d67a7da2 portability fixes. 2004-01-17 17:57:40 +00:00
lukem
a9beb0e443 Tokenization function enhancements:
* Make tok_init(), tok_end(), tok_reset(), tok_line() and tok_str()
  publically available in <histedit.h>
* Documented the public functions in editline(3)
* Renamed tok_line() -> tok_str()
* Added new tok_line() which takes a "const LineInfo *" instead of
  "const char *" (the former has "cursor" information), and optionally
  return the argv index ("int *cursorc") and offset within that index
  ("int *cursorv").  This means that completion routines can use the
  tokenization code to crack the line and easily find which word the
  cursor is at.  (mmm, context sensitive completion :)
* Fixed TEST/test.c when using "continuation" lines (unmatched quote
  or \ at EOL), and added some more DEBUG messages including highlighting
  where the cursor is (with a `_').
2003-12-05 13:37:48 +00:00
christos
1b8a2beb0c Fix uninitialized variable. 2003-11-03 03:22:55 +00:00
christos
8467a84273 From: Gerry Swislow gerry at certif dot com
1) File name completion should list the files in the current directory
if no text is entered.  The previous version wouldn't list anything if
the text to complete was empty.

2) When listing directories, the entries "." and ".." shouldn't be
shown.

3) The filename completion should be used if the user's
rl_attempted_completion_function doesn't return any matches.  The
previous version didn't do that.
2003-11-02 01:45:14 +00:00
christos
391b46bc7f initialize ptr. 2003-11-01 23:39:22 +00:00
christos
8b40dcaecf Make readline csh-like history work.
From Gerry Swislow <gerry at certif dot com>.
2003-10-27 22:26:35 +00:00
christos
52215a07e7 add rl_catch_signals 2003-10-19 06:28:35 +00:00
christos
5d79eff8f5 More libedit readline emulation functions from: Gerry Swislow
<gerry at certif dot com>
2003-10-16 22:26:32 +00:00
christos
378865a426 don't limit ^c to alpha c, and add VIS_NOSLASH so that vis(3) does not
produce \^c
2003-10-15 18:08:40 +00:00
christos
5eda4a7d47 PR/23107: Nathan Williams: ^D as the first char on the command line does
not DTRT in readline compatibility mode
2003-10-09 00:42:28 +00:00
christos
552716dcff Implement enough of readline's 4.0 async mode to make gdb happy. This is
not complete yet, but it seems to work...
This required to introduce an unbuffered mode to el_gets(), but that was
a minor change.
2003-09-26 17:44:51 +00:00
christos
7fb5c922f1 Match the stupid function pointer declarations with actual readline's 4.0.
This is gross.
2003-09-14 22:15:23 +00:00
christos
7bb332f70b make this compile. 2003-09-14 21:55:39 +00:00
christos
166e18a7fd - provide enough hooks to compile gdb-5.3
- fix el_get(e, EL_TERMINAL, (char **))
2003-09-14 21:48:54 +00:00
christos
9b8791db6c From michael@moria.de:
Fix realloc case where we could be running out of space if too many matches.
2003-06-19 16:04:57 +00:00
christos
839ca00b3c From michael@moria.de:
- use __attribute__((__unused__)) in arguments where appropriate.
- some int -> size_t and char * to const char * conversions.
2003-06-19 15:55:05 +00:00
wiz
0acfa3bb9e Consistently spell occurrence with two rs. 2003-03-29 22:48:37 +00:00
christos
1d6595e599 null is not 0 2003-03-10 01:14:54 +00:00
christos
bdc91aaf9a include alloca.h for systems that need it. 2003-03-10 00:56:38 +00:00
christos
98e93eb66e fix directory descriptor leak [from michael at moria dot de] 2003-01-21 17:41:38 +00:00
christos
05e3eaeb34 remove unused variables. 2002-10-27 21:43:35 +00:00
christos
a17c7fe4a6 vi mode and memory fixes from david laight. 2002-10-27 21:41:50 +00:00
christos
e6ee03013b don't crash in memory shortage conditions. 2002-10-27 20:24:28 +00:00
thorpej
4f7523a4cc _rl_qsort_string_compare(): Fix casts. This makes gcc 3.2 happy,
and also allows both LINTED comments to be removed.
2002-04-09 01:57:34 +00:00
christos
b2b9c150ac Add a couple linted comment and enable WARNS=3 2002-03-18 16:20:36 +00:00
christos
0e0ac6b723 - constify; passes all gcc and lint strict checks.
- add config.h [Jason Evans], to create a portable version of libedit that
  can be easily compiled on other OS's.
2002-03-18 16:00:50 +00:00