Commit Graph

29 Commits

Author SHA1 Message Date
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
christos e09118a532 Don't use HAVE_ yet. 2002-02-03 23:37:19 +00:00
christos 06968e10a6 Fix a warning. 2002-02-03 23:30:03 +00:00
mycroft 09aca455ce Remove an unused variable. 2001-11-08 19:34:41 +00:00
christos 18c98749bf If term_init() fails, cleanup and return NULL. This avoids other lossage.
Pointed by charles.
2001-11-02 04:47:47 +00:00
christos 545f12e0c5 PR/14188: Anthony Mallet: Provide an opaque data pointer to client programs. 2001-10-09 13:50:29 +00:00
christos eabba8b507 PR/14067: Anthony Mallet: Provide a programmatic way to set the read_char
function via a new el_set() operation.
Thanks, nicely done :-)
2001-09-27 19:29:50 +00:00
wiz 4c99916337 va_{start,end} audit:
Make sure that each va_start has one and only one matching va_end,
especially in error cases.
If the va_list is used multiple times, do multiple va_starts/va_ends.
If a function gets va_list as argument, don't let it use va_end (since
it's the callers responsibility).

Improved by comments from enami and christos -- thanks!

Heimdal/krb4/KAME changes already fed back, rest to follow.

Inspired by, but not not based on, OpenBSD.
2001-09-24 13:22:25 +00:00
christos 304ebe4875 depoison the pure editline code from readline compatibility hacks. 2001-01-05 22:45:30 +00:00
christos ff59a2fadd - add support for home and end keys.
- improve debugging support
2000-11-11 22:18:57 +00:00
lukem d30d584a91 convert to new style guide, which includes:
- ansi prototypes & features (such as stdargs)
- 8 space indents
2000-09-04 22:06:28 +00:00
chuck c23199d5e1 make xxgdb and a gdb linked with libedit's readline emulation work
properly together.   xxgdb communicates with a gdb running on a pty
that it sets to -echo,-onlcr prior to forking the gdb process.
GNU readline preserves the -echo setting while libedit was undoing it
(setting the tty to a sane state and totally confusing xxgdb's parser).

this diff simply disables libedit if both readline emulation and
"stty -echo" are used/set.   that is enough to make xxgdb work once
again, but (XXX) this is not how GNU readline handles stty -echo (it
does not echo anything, but editing commands like ^A,^K, etc.
still work), so the readline emulation isn't perfect.

change reviewed by christos.
2000-08-02 03:36:39 +00:00
sommerfeld 01d7e8693f Only look in home directory for .editrc. (Discussed with Christos.) 2000-06-28 20:37:44 +00:00
christos cd8eacbb27 don't dump core on empty files. 2000-05-15 12:15:38 +00:00
lukem 509864fa8f - implement printing a right-side prompt. code derived from similar work
I wrote for tcsh(1) three years ago.
- implement EL_RPROMPT, which allows a setting/getting of a function which
  returns a string to be used as the right-side prompt.
- improve HISTORY and AUTHORS sections in editline(3).
- bump shlib minor version for EL_RPROMPT.

XXX: due to an implementation issue, the rprompt has a 1 space gap before the
     edge of the logical screen. editline's logical screen is 1 space less
     than the full screen width, so there's a 2 space gap between the rprompt
     and the right end of the physical screen. i'm not concerned about this.
1999-11-12 01:05:07 +00:00
lukem 8494e0e800 * in el_source():
- don't reopen fp if it was successfully opened in a previous check
	- use strlcpy()/strlcat() instead of snprintf() to build a pathname,
	  since the former are more portable to other systems than the latter
* whitespace fascism
1999-09-21 00:55:55 +00:00
simonb 1528b77539 More trailing white space. 1999-07-02 15:14:07 +00:00
christos a6d4afba22 delint 1998-12-12 20:08:21 +00:00
christos 5e435627f6 fix core-dump caused by maps not being initialized before tty is called. 1998-09-28 11:00:05 +00:00
lukem f87d250404 * add more checks for NULL pointers in passed arguments
* implement el_get(EditLine *, int op, void *result), which does the
  inverse of el_set()
* add EL_EDITMODE operation to el_set and el_get; if non zero editing
  is enabled (the default).
* add "edit  on | off" editrc command, which modifies EL_EDITMODE.
  users can now add '*:edit off' in ~/.editrc as an advisory to
  disable editing.

NOTE: at this time EL_EDITMODE is just an indication of the
state of the 'edit' command. It's up to the application to check
this after el_source() or el_parse() to determine if editing is still
required.
1998-07-29 02:26:00 +00:00
christos ff2402b524 el_init takes a third stream argument and add el_beep. 1998-05-20 01:01:00 +00:00
christos c49189ae41 Small optimization. Don't call isatty() on every invocation of el_gets, but
remember if the tty setup failed... Also trim the input line of trailing \r's.
1997-12-20 19:15:50 +00:00
christos 54fac6850e Fix compiler warnings. 1997-07-06 18:25:21 +00:00
christos 753977f439 Handle properly the case where the last line in the sourced file does
not have a trailing '\n'. From Jeffrey C Honig.
1997-04-24 18:54:16 +00:00
christos eb54427340 Portability fixes:
__const		-> const
BADSIG		-> SIG_ERR
int flags	-> u_int flags
#if __STDC__	-> #ifdef __STDC__
1997-04-11 17:52:44 +00:00
christos 3ff63340c3 Fix potential stack overflow; from Keith Bostic. 1997-03-20 16:42:32 +00:00
lukem e69e9fbfa5 fix el_source() - a block needed braces around it (the indenting fooled me) 1997-01-17 01:03:33 +00:00
lukem 2543e3e651 RCSid police
editline first appeared in 4.4BSD not NetBSD1.0
1997-01-11 06:47:47 +00:00
cgd 6dc2f1db52 libedit! 1994-05-06 06:01:42 +00:00