Commit Graph

270 Commits

Author SHA1 Message Date
christos 3a7857f16d Use ${HOST_SH} 2003-05-08 13:20:44 +00:00
wiz 472351e13d Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
2003-04-16 13:34:34 +00:00
perry 702861031b em-gosmacs-traspose->em-gosmacs-transpose (Igor Sobrado, PR misc/19909) 2003-03-31 16:52:42 +00:00
wiz 0acfa3bb9e Consistently spell occurrence with two rs. 2003-03-29 22:48:37 +00:00
christos 80a839beda don't use the path for awk 2003-03-10 21:21:10 +00:00
christos 687b5d51e3 s/u_int32_t/unsigned int/ 2003-03-10 21:18:49 +00:00
dsl 25456aecdb Put the __weak_extern() back inside vi_alias, but after the extern for
get_alias_text().
2003-03-10 11:09:25 +00:00
he d5428a2906 Move the __weak_extern() (ifdef'ed) outside of the vi_alias()
function, so that this compiles again.
2003-03-10 09:55:10 +00:00
christos 1d6595e599 null is not 0 2003-03-10 01:14:54 +00:00
christos 2ffae6453d if no __weak_extern, don't even try to do vi_alias. 2003-03-10 01:14:07 +00:00
christos 61c24e2c2a fix uninitialized variable.
grr, I want gcc-3.3
2003-03-10 01:05:12 +00:00
christos 5f1f221c24 sig_t is non portable 2003-03-10 00:58:05 +00:00
christos 23dbd749a2 - include cdefs.h early in the game
- ifdef notdef the sunos stuff
- no need for sig_t
2003-03-10 00:57:38 +00:00
christos bdc91aaf9a include alloca.h for systems that need it. 2003-03-10 00:56:38 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
wiz 831ba492c3 Replace -1 with \-1 for PostScript output; drop a trailing space and fix two typos. 2003-01-21 23:00:56 +00:00
christos f24857bf36 Add a uniquefier for the history function. 2003-01-21 18:40:23 +00:00
christos 98e93eb66e fix directory descriptor leak [from michael at moria dot de] 2003-01-21 17:41:38 +00:00
christos 4a97685c19 Fix problem with previous patches that broke vi history.
- c_gets() was usually returning a length, but sometimes
  one of the CC_xxx values (which are small +ve integers)!
- fixed c_gets() by putting a ' ' under the cursor.
From David Laight.
2002-11-20 16:50:08 +00:00
christos d10066b927 de-lint 2002-11-15 14:33:53 +00:00
christos 39f224af48 PR/18995: David Laight: libedit fixes for posix conformant sh
The posix 'sh' specification defines vi-mode editing quite tightly.
The netbsd libedit code (used by sh to do this) was missing several
features, there were also minor errors in others.

Compare netbsd sh to the definition available from:
http://www.opengroup.org/onlinepubs/007904975/utilities/sh.html
In particular the following were not supported:
	U - undo all changes to line
	| - goto column
	Y - yank to end of line
	y - yank
	# - comment out current line
	@ - take input from shell alias [1]
	G - goto numbered line in history buffer
	v - edit history line with vi
	_ - append word from last input line
	. - redo last command
Other minor changes have also been made.

[1] This needs the shell to define an appropriate routine to
return the text of the alias.  There is no requirement that
such a function exist.
2002-11-15 14:32:32 +00:00
thorpej f53bc0b607 Fix signed/unsigned comparison warnings. 2002-11-12 00:01:21 +00:00
thorpej aa27d116a6 Avoid strict alias warning. 2002-11-12 00:00:23 +00:00
christos 905b699ab7 support for % command [matching parens/brackets/braces] on vi modes.
From David Laight, thanks!
2002-10-31 02:01:46 +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
christos 8572d89c2c PR/17954: SAITOH Masanobu: since we have opost and onlcr set, we don't need
to output \r to go to the end of line; \n is enough. From David Laight.
2002-10-27 20:04:36 +00:00
christos 4a964eaf87 write the vis(3) converted string into the file, not the original one.
Noted by Tim Robbins. Hi luke!
2002-10-13 17:15:53 +00:00
wiz 489a979d23 empty, not emptry. By Adrian Mrva. 2002-10-02 11:06:11 +00:00
wiz 28128e0592 New sentence, new line. From Robert Elz. 2002-10-01 19:03:15 +00:00
lukem ec5dbc56b8 Explicitly move setting of NOxxx and USE_SHLIBDIR to the top of the
Makefile (before including <bsd.own.mk>)
2002-08-19 14:55:14 +00:00
lukem 91d06a031b More use of ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path 2002-08-19 13:35:05 +00:00
yamt de6b808960 reflect reality.
(3rd arg of el_parse is const.)
2002-08-18 07:23:21 +00:00
soren 642c31b4a3 Remove extraneous \n's in {err,warn}{,x}. 2002-08-09 10:01:53 +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 8a47c9318b make sure this compiles cleanly and works. 2002-03-23 23:39:18 +00:00
christos b2b9c150ac Add a couple linted comment and enable WARNS=3 2002-03-18 16:20:36 +00:00
christos aef033dfd3 oops, we need config.h now. 2002-03-18 16:19:03 +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
wiz fba3aac827 Close quoting. 2002-02-20 11:54:16 +00:00
ross 814f296b77 Generate <>& symbolically. 2002-02-07 07:00:09 +00:00
christos daf8abfc47 Fixed an __P remnant 2002-02-03 23:37:53 +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
christos 910773a8f9 don't forget to re-adjust the limit. 2002-01-31 02:27:31 +00:00
christos a4b0370f1d make pointer arithmetic more palatable. 2002-01-31 00:25:33 +00:00
wiz 2fc1ec38f2 Punctuation nits. 2002-01-15 02:46:44 +00:00
wiz a0d025c5d3 Punctuation and whitespace nits, fix a typo. 2002-01-15 02:46:22 +00:00
lukem efcc9a4c9d * Add user-controlled mk.conf variables
- SHLIBDIR	Location to install shared libraries if ${USE_SHLIBDIR}
			is "yes".  Defaults to "/usr/lib".

	- USE_SHLIBDIR	If "yes", install shared libraries in ${SHLIBDIR}
			instead of ${LIBDIR}.  Defaults to "no".
			Sets ${_LIBSODIR} to the appropriate value.
			This may be set by individual Makefiles as well.

	- SHLINKDIR	Location of shared linker.  Defaults to "/usr/libexec".
			If != "/usr/libexec", change the dynamic-linker
			encoded in shared programs

* Set USE_SHLIBDIR for libraries used by /bin and /sbin:
	libc libcrypt libcrypto libedit libipsec libkvm libm libmi387
	libtermcap libutil libz

* If ${_LIBSODIR} != ${LIBDIR}, add symlinks from ${LIBDIR}/${LIB}.so*
  to ${_LIBSODIR}/${LIB}.so* for compatibility.

* Always install /sbin/init statically (for now)


The net effect of these changes depends on how the variables are set:

  1.)	If nothing is set or changed, there is no change from the
	current behaviour:
		- Static /bin, /sbin, and bits of /usr/*
		- Dynamic rest
		- Shared linker is /usr/libexec/ld*so

  2.)	If the following make variables are set:
		LDSTATIC=
		SHLINKDIR=/lib
		SHLIBDIR=/lib
	Then the behaviour becomes:
		- Dynamic tools
		- .so libraries used by /bin and /sbin are installed to /lib,
		  with symlinks from /usr/lib/lib*so to -> /lib/lib*so
		  where appropriate
		- Shared linker is /lib/ld*so

  3.)	As per 2.), but add the following variable:
		USE_SHLIBDIR=yes
	This forces all .so's to be instaleld in /lib (with compat
	symlinks), not just those tagged by their Makefiles to be.
	Again, compat symlinks are installed
2001-12-28 01:32:37 +00:00
tv 001067bbd1 Readability cleanups; MKfoo=no -> NOfoo. 2001-12-12 00:51:00 +00:00
mycroft 676fa7ff61 In the `not what I asked for' department:
Do NOT return an error from term_init() if term_set() fails.  Otherwise
el_init() barfs and libedit fails to work.
2001-11-08 19:39:10 +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 41df15832a Finish initializing all the term data structures even if the terminal init
fails. This makes editline work on dumb terminals again. Noted by mycroft.
Oops, too agressive error checking.
2001-11-02 04:42:09 +00:00
christos 545f12e0c5 PR/14188: Anthony Mallet: Provide an opaque data pointer to client programs. 2001-10-09 13:50:29 +00:00
lukem ab71bef52a a couple of minor fixes. originally by Ruslan Ermilov <ru@FreeBSD.org>,
highlighted to me by way of Mike Barcroft <mike@FreeBSD.org> (thanks!)
2001-10-04 00:45:19 +00:00
jdolecek e7e71e37c6 history_def_enter: fix off-by-one mistake in delete condition (the behaviour
to keep at least one entry on the history list is retained)
This fixes lib/9704 by Phil Nelson.
2001-09-29 17:52:10 +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
wiz 3f9984fc90 `existent', not `existant' 2001-06-19 13:42:07 +00:00
christos 93819542b3 PR/12963:Jason Waterman: Fix signed cast problems. 2001-05-17 01:02:17 +00:00
enami e58d00a406 Use relative path for symlink target so that it won't point outside of tree. 2001-05-16 07:09:26 +00:00
jdolecek 049f74e997 Back off previous and do differently:
Ensure that the <readline/history.h> link to <readline/readline.h> is
installed too for 'make includes'. Also, avoid creating obj dir.
This is finally real fix for lib/12929.
XXX Is this right?
2001-05-14 18:39:14 +00:00
jdolecek 6fc3f969bf Use <bsd.inc.mk>, instead of <bsd.prog.mk>, so that the readline.h header
is installed during the 'make includes'.
Fixes lib/12929 by Martin Husemann.
2001-05-14 07:41:30 +00:00
lukem 5e45b51a6b knf ch_enlargebufs(), to be *consistent* with the rest of this file... 2001-04-13 01:04:19 +00:00
lukem 4241f48b35 rename 3 arg ELRE_DEBUG to ELRE_ASSERT, add 2 arg ELRE_DEBUG, and change all
occurences of ELRE_DEBUG(foo,bar,) -> ELRE_DEBUG(foo,bar).  some compilers
(e.g, gcc on darwin) bitch about the former (`not enough args').
2001-04-13 00:53:11 +00:00
wiz caeeeac59d End sentence with a dot. 2001-04-02 18:29:49 +00:00
christos e125f8f194 chmod the history file to 600 so that only the owner can read it.
[inspired by the openbsd fix to readline]
2001-03-20 00:08:31 +00:00
jdolecek 86ebf640b0 sprinkle couple const 2001-01-23 15:55:30 +00:00
jdolecek d64e200968 term_rebuffer_display(): set el->el_term.t_size.v to terminals
height, not a magic value, so that e.g. el_display[] and el_vdisplay[]
are not bigger than needed.
Discussed with Christos Zoulas.
2001-01-10 22:42:56 +00:00
jdolecek 3b81461031 fix partial completion - we failed to refresh screen in that case 2001-01-10 08:10:45 +00:00
jdolecek 00ff7cacf5 Enlarge editline buffers as needed to support arbitrary length lines.
This also addresses lib/9712 by Phil Nelson.
2001-01-10 07:45:41 +00:00
jdolecek c8093bd336 term_beep(): use ordinary bell, don't attempt to use visual bell - if user wants
visual instead of ordinary bell, they should set their environment
appropriately
2001-01-09 19:43:15 +00:00
jdolecek 7be4ef2ff0 make array of functions and help array const 2001-01-09 19:22:31 +00:00
jdolecek 417c215317 make constant arrays a const 2001-01-09 17:31:04 +00:00
jdolecek a76c617ce5 make constant arrays a const 2001-01-09 17:22:09 +00:00
jdolecek fa6e217baf el_line_t: make 'limit' const 2001-01-06 14:44:50 +00:00
christos 304ebe4875 depoison the pure editline code from readline compatibility hacks. 2001-01-05 22:45:30 +00:00
jdolecek 74c6c9c204 Standard location of readline headers is /usr/include/readline/, so install
them there.
readline.h of libedit had to move to subdirectory 'readline', due to the way
BSD makefiles work; this is better than potentially fragile Makefile hacks
2001-01-05 21:15:49 +00:00
christos 2f3389ce5e consistently check for allocation failures and return -1, if we could not
get more memory.
2001-01-04 15:56:31 +00:00
christos ab7e5eaeb3 fix lint problems. 2001-01-04 15:55:53 +00:00
christos ed19c5fdb0 fix dumb typo in signal setup [from OpenBSD]
return -1 if alloc fails.
2001-01-04 15:55:03 +00:00
jdolecek a8b4a741c5 bump libedit minor - addition of rl_special_prefixes and rl_completion_append_character 2001-01-01 15:54:07 +00:00
jdolecek a85f9ca211 Add support for rl_completion_append_character and rl_special_prefixes.
This addresses lib/10513 by Giles Lean. Tested with PostgreSQL 7.0.2 psql.
2001-01-01 15:52:25 +00:00
jdolecek 939ac12578 history_tokenize(): fix one off-by-one bug
rl_complete_internal(): only replace the completed string with common part
	of possible matches if there is a possible completion
2001-01-01 11:03:16 +00:00
jdolecek 26ffe99b32 rl_display_match_list():
* pad entries shorter than 'max' by spaces correctly
	* fix off-by-one error which caused extra newline to be printed
	  if the list fit exactly to a screen
	* fix typo in _rl_qsort_string_compare, which caused the list to not
	  be sorted after all
2000-12-31 09:50:32 +00:00
jdolecek c860130fa0 term_beep(): if terminal supports both visual and ordinary bell, 'ring' both 2000-12-30 22:46:05 +00:00
jdolecek 2c10cd6472 bump libedit minor - added some public stuff for readline emulation 2000-12-23 22:07:16 +00:00
jdolecek 4acffb6417 completion_matches(): fix a off-by-one bug, fix variable name typo
implement displaying of possible completions, add hook to display the list
	on second rl_complete() invocation in row (typically, double <TAB>)

This addresses the completion part of lib/11581 by Richard Earnshaw.
2000-12-23 22:02:20 +00:00
jmc 50b6095c16 Alloc the keys structure with A_K_NKEYS as the multiplier rather than a
hardcoded value of 4.

A_K_NKEYS is currently 6 and this mismatch was stomping memory when
initializing the keys. (specifically gdb lost the exec file name if it was
a long path name).
2000-11-28 22:37:51 +00:00
christos ff59a2fadd - add support for home and end keys.
- improve debugging support
2000-11-11 22:18:57 +00:00
lukem cff6006e56 improve description of line syntax 2000-11-08 00:09:38 +00:00
sommerfeld acf589519a format string audit (silence warnings, save space) 2000-10-04 16:21:39 +00:00
lukem 6592086aee - generate ansi prototypes instead of using __P(). noted by christos
- fix a couple of comments
2000-09-04 23:45:18 +00:00
lukem e4b166ade0 convert to new style guide 2000-09-04 23:36:41 +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
lukem f5e2e0bfea history_def_set has a `const int' as a third arg, not an `int'.
picked up by the ultrix compiler, reported by simonb@ ...
2000-08-29 07:04:32 +00:00
mrg 7f59d8e891 use .tmp temporaries for generated files, to avoid having failed generated
output being used.
2000-08-15 12:01:40 +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