Commit Graph

192 Commits

Author SHA1 Message Date
David E. O'Brien
5293615570 Correct r228114 and use the same implementation for tilde.h as for history.h 2012-04-26 00:51:43 +00:00
Ed Schouten
59340eb8e2 Don't use __P().
The rest of the file doesn't use it either and according to style(9), it
should not be used.
2011-12-13 14:53:26 +00:00
Max Khon
1e671ba260 Use INCSLINKS so that "make installincludes" installs links during buildworld. 2011-11-29 06:21:01 +00:00
Max Khon
8480e502f4 - Hide _rl_qsort_string_compare() that should be private to libreadline()
implementation.
- Add symlink /usr/include/edit/readline/tilde.h -> readline.h

All this makes it possible to build and link gdb with -ledit.
2011-11-29 04:50:57 +00:00
David E. O'Brien
189e4fad8a Add $FreeBSD$'s. 2011-04-14 15:42:15 +00:00
David E. O'Brien
1e3f14466b * Add the readline(3) API to libedit. The libedit versions of
{readline,history}.h are in /usr/include/edit so as to not conflict with
  the GNU libreadline versions.  To use the libedit readline(3) one should
  add "-I/usr/include/edit" to their Makefile
  (spelled "-I${DESTDIR}/${INCLUDEDIR}/edit" within the FreeBSD source tree).

* Enable its use in the BSD licensed utilities that support readline(3).

* To make it easier to sync libedit development with NetBSD, histedit.h
  is moved into libedit's directory as history shows shown we keep merging
  it into that location.

Obtained from:	NetBSD
Sponsored by:	Juniper Networks
2011-04-05 18:41:01 +00:00
Jilles Tjoelker
b3c63ff614 libedit: Try to map <Delete> to ed-delete-next-char.
This adds a new "arrow" key "delete" corresponding to the kD termcap value.
It only works if that is a sequence such as "\033[3~"; if it is "\177", the
em-delete-prev-char or ed-delete-prev-char from the single-character
mappings remains. It turns out that most terminals (xterm and alikes,
syscons in xterm mode) produce "\033[3~" by default so <Delete> has the
expected effect.

This also means that things need to be considerably misconfigured for
<Backspace> to perform a <Delete> action.
2010-09-05 16:12:10 +00:00
Jilles Tjoelker
96e75396e1 libedit: Do not move the cursor for ed-delete-next-char in emacs mode.
This makes ed-delete-next-char suitable for mapping to the <Delete> key.

Behaviour in vi mode is unchanged (for 'x').
2010-09-03 22:24:26 +00:00
Joel Dahl
c2025a7660 Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages.  Minor corrections by me.

Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
2010-08-16 15:18:30 +00:00
Jilles Tjoelker
196ff96e78 libedit: Reduce surprising behaviour with filename completion some more:
* Quote '*', '?' and '['. While it may be more useful to expand them to
  matching pathnames, this at least matches with the completion we do.
* '@' is a regular character for filenames. Some other shells do
  @<hostname> completion but we do not.
* Prefix names starting with '-' and '+' with './' so they are not seen as
  options.
2010-06-15 22:23:21 +00:00
Jilles Tjoelker
3d0f8bcd30 libedit: Allow simple quoting in filename completion.
The completer recognizes characters escaped with backslashes as being
literal parts of a word, and adds backslashes to avoid almost all
misinterpretation. In particular, filenames containing spaces can be
completed correctly.

For bug compatibility with the NetBSD version, the improved completion
function has a new name, _el_fn_sh_complete, and _el_fn_complete is
unchanged.

Submitted by:	Guy Yur
2010-06-15 21:34:57 +00:00
Jilles Tjoelker
da8301c83a libedit: Fix a bug that could make completion listings incomplete.
The element matches[0] is the common prefix and is not counted in len, so
subtracting 1 is not needed. A counter for the number of matches per line
was incremented twice.

Submitted by:	Guy Yur
2010-06-15 21:00:53 +00:00
Jilles Tjoelker
96535454fc libedit: Add basic filename completion code from NetBSD.
This will be used to provide filename completion in sh(1).

Changes from the NetBSD code:
* wide character support disabled, as in the rest of libedit
* config.h and related portability stuff reduced/disabled, as in the rest
  of libedit

Submitted by:	Guy Yur
Obtained from:	NetBSD
2010-06-13 17:04:42 +00:00
Ulrich Spörlein
aa12cea2cc mdoc: order prologue macros consistently by Dd/Dt/Os
Although groff_mdoc(7) gives another impression, this is the ordering
most widely used and also required by mdocml/mandoc.

Reviewed by:	ru
Approved by:	philip, ed (mentors)
2010-04-14 19:08:06 +00:00
Joel Dahl
f32419adfb The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Obtained from:	NetBSD
2010-03-02 07:25:20 +00:00
Ed Schouten
daaf575910 Build lib/ with WARNS=6 by default.
Similar to libexec/, do the same with lib/. Make WARNS=6 the norm and
lower it when needed.

I'm setting WARNS?=0 for secure/. It seems secure/ includes the
Makefile.inc provided by lib/. I'm not going to touch that directory.
Most of the code there is contributed anyway.
2010-01-02 09:58:07 +00:00
Ken Smith
3ca3047aee Bump the version of all non-symbol-versioned shared libraries in
preparation for 8.0-RELEASE.  Add the previous version of those
libraries to ObsoleteFiles.inc and bump __FreeBSD_Version.

Reviewed by:    kib
Approved by:    re (rwatson)
2009-07-19 17:25:24 +00:00
Stefan Farfeleder
47517a7042 Merge NetBSD changes, among them:
el.c 1.44, el.h 1.17, editline.3 1.53, histedit.h 1.31:
# add EL_GETFP, and EL_SETFP.

el.c 1.42, term.c 1.46, term.h 1.18, editline.3 1.52, histedit.h 1.29:
# - Add more readline functions, enough for gdb-6.5
# - Make el_get varyadic, and implement EL_GETTC.
# - XXX: the EL_SETTC api will change in the future.

Note: The latter change breaks the ABI of the el_get() function.

Approved by:	re (kensmith)
2007-06-10 19:06:09 +00:00
Daniel Eischen
419ecd5dee Bump library versions in preparation for 7.0.
Ok'd by:	kan
2007-05-21 02:49:08 +00:00
Stefan Farfeleder
f9ff2f8ffb Merge the following changes from NetBSD:
history.c 1.32:
  # Fix memory leak found by valgrind (Julien Torres)
map.c 1.24:
  # fix debugging printf format.
read.c 1.40:
  # Fix bug with multiple pending el_pushes. Reported by Julien Torres.
tty.c 1.24:
  # Coverity CID 1216: Prevent negative index use.

MFC after:	3 weeks
2007-03-11 21:47:40 +00:00
Stefan Farfeleder
e6de94e677 Merge the following changes from NetBSD:
chared.h 1.17, common.c 1.19, emacs.c 1.21, key.c 1.18, key.h 1.9, map.c 1.23,
term.c 1.42, term.h 1.17, vi.c 1.25:
  # Print the actual eofc, instead of ^D\b\b.
  # Change internal character decoding to prevent buffer oveflows.
key.c 1.19, key.h 1.10:
  # move declaration to header file.
term.c 1.43:
  # Coverity CID 806: Prevent NULL deref
term.c 1.44:
  # Coverity CID 1668: Plug memory leak.
term.c 1.45:
  # Fix compilation.

MFC after:	3 weeks
2007-03-11 18:30:22 +00:00
Stefan Farfeleder
370bf6653c Merge changes to the NetBSD copyright (advertising clause removal). 2007-03-11 08:41:01 +00:00
Stefan Farfeleder
2c05ef0cff Merge NetBSD's revision 1.27. This bug can be observed eg. when browsing
through the history in sh.

| Refresh bug reported by Julien Torres:
|
| going from:
|     activate -verbose
| to:
|     reset -activation
| results in:
|     reset -activationverbose"
| instead of:
|     reset -activation
|
| This is because we choose to insert "reset -" before the current line,
| and the delete "e -" and insert "ion" in the appropriate place. The
| cleareol code did not handle this case properly; we now cleareol to
| the maximum number of characters of the first difference, the second
| difference and the difference in line length.
2005-12-04 09:34:56 +00:00
Ruslan Ermilov
41792fb59f Fix prototype. 2005-11-24 10:32:39 +00:00
Ruslan Ermilov
110e1704d3 -mdoc sweep. 2005-11-17 13:00:00 +00:00
Stefan Farfeleder
22b1904845 Add el_get to the NAME section.
Obtained from:	OpenBSD (via NetBSD)
2005-10-20 08:26:03 +00:00
Stefan Farfeleder
6dea540edc Merge makelist rev 1.10 and map.c rev 1.22 from NetBSD. They just patch the
bug fixed in the last commit to map.c in a different way.  Follow NetBSD to
facilitate future merges.
2005-10-04 21:59:29 +00:00
Stefan Farfeleder
51890f2fed Merge NetBSD's rev. 1.49:
Fix double if (from Alexey E. Suslikov via jmc@openbsd).
While here, re-word both H_[GS]ETUNIQUE descriptions so they make
more sense. Bump date.
2005-10-04 21:51:26 +00:00
Stefan Farfeleder
bc6e20f014 Merge NetBSD's rev. 1.41:
PR/31012: Barry Naujok: libedit el_get with EL_EDITOR op does not work
Fixed as suggested.
2005-10-04 21:45:42 +00:00
Stefan Farfeleder
442861ce97 Move <sys/cdefs.h> up to reduce diff to NetBSD. 2005-08-10 13:41:31 +00:00
Stefan Farfeleder
7bcbf4cce9 Submitted to and merged from NetBSD (rev. 1.23 and 1.24):
- Don't delete the current line when typing `yy'.
- Don't use a possibly stale pointer in cv_paste().
-
2005-08-10 13:38:01 +00:00
Stefan Farfeleder
cc5ed4050e NetBSD merged our typo fixes, update $NetBSD$. 2005-08-09 13:37:59 +00:00
Stefan Farfeleder
3d37ccb1e9 Merge a change I missed in the last commit. 2005-08-09 13:35:48 +00:00
Stefan Farfeleder
06ce2f8d05 Merge NetBSD's 1.25 which fixes a small bug introduced in 1.24. 2005-08-09 13:31:59 +00:00
Stefan Farfeleder
8131ad836a Include <term.h> before #undef'ing key_clear. 2005-08-08 17:17:56 +00:00
Stefan Farfeleder
c22964d7eb Fix a few typos. 2005-08-08 07:08:35 +00:00
Stefan Farfeleder
1d22b4120f Don't forget to copy the sentinel into the `help' array. It's expected to
be there.

Submitted by:	Björn König
PR:		82381
2005-08-08 07:03:50 +00:00
Stefan Farfeleder
76d00450e6 Sync libedit with recent NetBSD developments. Including improvements to the
vi-mode, removal of clause 3, cleanups and the export of the tokenization
functions.

Not included: config.h, filecomplete.{c,h}
2005-08-07 20:55:59 +00:00
Stefan Farfeleder
969f700138 Revert the replacement of realloc() with reallocf() (el.h:1.2, map.c:1.5 and
tokenizer.c:1.3).  Contrary to the commit log there were no memory leaks,
but the change introduced a bug because the free'd pointer was not zeroed
and calling the appropriate _end() function would call free() a second time.
2005-08-07 08:35:39 +00:00
Ken Smith
a84020c2b9 Bump the shared library version number of all libraries that have not
been bumped since RELENG_5.

Reviewed by:	ru
Approved by:	re (not needed for commit check but in principle...)
2005-07-22 17:19:05 +00:00
Ruslan Ermilov
36a142c455 Expand contractions. 2005-02-13 23:45:54 +00:00
Ruslan Ermilov
0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Ruslan Ermilov
fe08efe680 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
David E. O'Brien
4f4a104ee8 style.Makefile(5) 2003-08-18 15:25:39 +00:00
Gordon Tetlow
41d8423f71 Stage 3 of dynamic root support. Make all the libraries needed to run
binaries in /bin and /sbin installed in /lib. Only the versioned files
reside in /lib, the .so symlink continues to live /usr/lib so the
toolchain doesn't need to be modified.
2003-08-17 08:28:46 +00:00
Andrey A. Chernov
90862ca23d LANG->LC_ALL
Pointed by:     ru
2003-08-04 21:31:53 +00:00
Andrey A. Chernov
11871d537b Fix problem differently, use
LANG=C tr 'a-z' 'A-Z'
for hypotetical case that script may generate non-ascii characters
2003-08-04 15:24:06 +00:00
Andrey A. Chernov
e9e76fa4dd Fix double-wrong tr usage: tr '[a-z]' '[A-Z]'
First of all, it should be written as: tr 'a-z' 'A-Z'
ranges not encolosed in [] according to POSIX, so [] just included
in the replacement.
Second, it should be written: tr '[:lower:]' '[:upper:]'
since a-z and A-Z may have different length in some locales.
2003-08-04 14:10:33 +00:00
Philippe Charnier
50f0640536 The .Fn function 2003-02-06 11:25:03 +00:00
Jens Schweikhardt
9d5abbddbf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
Jens Schweikhardt
d64ada501a Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.
2002-12-30 21:18:15 +00:00
Jens Schweikhardt
57bd0fc6e8 english(4) police. 2002-12-27 12:15:40 +00:00
Tim J. Robbins
3a0e6ca553 Write the strvis()'d string out to the history file in history_save(),
not the original string. Fixes the bug where every second line of a
history file was empty.
2002-10-14 10:42:38 +00:00
Tim J. Robbins
57185ffa08 FreeBSD's libedit does not include NetBSD's readline emulation code.
Remove references to it from the Authors and History sections.
2002-10-13 08:46:57 +00:00
Peter Wemm
224af215a6 Zap now-unused SHLIB_MINOR 2002-09-28 00:25:32 +00:00
Matthew N. Dodd
2b13992856 Restore local bits lost in recent merge from NetBSD. 2002-06-16 08:29:35 +00:00
Dag-Erling Smørgrav
d397408818 Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.
2002-04-22 13:44:47 +00:00
Ruslan Ermilov
357bbe4abe -ltermcap is spelled -lncurses nowadays. 2002-04-09 13:04:31 +00:00
David E. O'Brien
69160b1eb7 Remove __P() usage. 2002-03-21 23:54:04 +00:00
David E. O'Brien
e95d27b9ae Fix problem where with PicoBSD the shell coredumps if it does not find an
entry for its terminal type in /etc/termcap.

Submitted by:	bde
2002-01-24 13:54:19 +00:00
Ruslan Ermilov
224049f515 mdoc(7) police: markup nit in the actual rev. 1.13 changes. 2001-11-21 15:56:45 +00:00
Ruslan Ermilov
7b3fbdf9b4 mdoc(7) police: restore all FreeBSD fixes to this file that got
clobbered by previous commit.
2001-11-21 15:50:57 +00:00
David E. O'Brien
4f375b90fc Clean this up after the NetBSD syncing. 2001-10-01 23:10:48 +00:00
David E. O'Brien
0878b3a9b1 Fix ID's after a total boch CVS merge due to multiple people making
commits to these files.
As I sing to CVS:
	Have I told you lately that I hate your guts?  Have I told you
	all SCM's are above you?  You fill my heart with pain, take away
	all my merging joy, grow my troubles that's what you do."
2001-10-01 23:00:29 +00:00
David E. O'Brien
be4f05c4f6 Our histedit.h lives in src/include. 2001-10-01 21:08:03 +00:00
Ruslan Ermilov
fef722a4a0 Re-applied some of rev. 1.11 and 1.13 fixes that were lost in the last commit.
Fixed some more.
2001-10-01 15:53:07 +00:00
David E. O'Brien
3c19577344 + Sync with NetBSD, bringing in feature enhancements.
+ Convert to ANSI-C function definitions
+ style(9)

Submitted by:	kris
2001-10-01 08:41:27 +00:00
Matthew Dillon
0622d6c77b Add __FBSDID()s to libedit 2001-09-30 21:21:36 +00:00
Ruslan Ermilov
57e4378bf6 mdoc(7) police: protect trailing full stops of abbreviations
with a trailing zero-width space: `e.g.\&'.
2001-08-10 13:45:36 +00:00
Ruslan Ermilov
c4d9468ea0 mdoc(7) police:
Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.
2001-08-07 15:48:51 +00:00
Dima Dorfman
7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Ruslan Ermilov
a307d59838 mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 13:41:46 +00:00
Andrey A. Chernov
6055a95fee Back out history.3 link removing - conflict fixed in libreadline instead 2001-04-12 09:57:12 +00:00
Andrey A. Chernov
45b655df03 Comment out one of many editline.3 MLINKS conflicting with libreadline
(history.3)
2001-04-12 03:33:13 +00:00
Ruslan Ermilov
4a558355e5 MAN[1-9] -> MAN. 2001-03-27 17:27:19 +00:00
Ruslan Ermilov
d0353b836e mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
Ruslan Ermilov
32f6256a49 Prepare for mdoc(7)NG. 2001-01-16 09:08:22 +00:00
Kris Kennaway
cca0db7e7e Constify 2000-11-26 11:07:45 +00:00
Ruslan Ermilov
725ab6287f log 2000-11-22 09:23:54 +00:00
Brian Somers
f234c674c1 Include fcntl.h
PR:		21697
Submitted by:	Barak Enat <barak_enat@yahoo.com>
2000-10-02 22:07:53 +00:00
Andrey A. Chernov
e796fe86bc Teach library about Home/End keys 2000-07-28 00:42:54 +00:00
Andrey A. Chernov
059b139f43 Fully preserve original tty settings outside of line edition mode. Old variant
preserve them only partially, so tty state becomes different after el_*
functions used.

PR:		20138
2000-07-28 00:07:40 +00:00
Andrey A. Chernov
5af16a0159 Move terminal descriptor flush before stty to eliminate potential problems
whith characters conversion changed like \n -> \r\n and so on.
2000-07-27 23:58:35 +00:00
Andrey A. Chernov
1c9ccb6f8e Fix temp. singnals blocking. Only one signal was blocked due to typo pasted
many times.
2000-07-26 23:46:28 +00:00
Warner Losh
04f058dbd1 <blush> I tested the real code changes, but neglected to test the
insertion of $FreeBSD$.  I miffed it (pointy hat please).  Hopefully
no one will notice this short window where -current didn't compile.
2000-05-22 06:01:31 +00:00
Warner Losh
4d1c36051e Do not read editrc file from '.'. This can be as unsafe as having
. first in root's path.

While I'm here:
	o Add $FreeBSD$
	o Get errno from <errno.h>, but extern int errno.

Submitted by: Tim Vanderhoek
2000-05-22 05:55:22 +00:00
Warner Losh
95e529fd59 Make comment match code forgotten in last commit 2000-05-22 05:51:09 +00:00
Warner Losh
0d39b3903f Add $FreeBSD$ so I can commit:
Remove extern int errno;.  Instead include the ANSI <errno.h>.  No
functional changes, just a higher level of pedantry.
2000-05-22 05:49:31 +00:00
Alexey Zelkin
490b02b624 Introduce .Lb macro to libedit manpage 2000-04-22 16:01:33 +00:00
Marcel Moolenaar
1b779c59bf Fix style bugs
Submitted by: bde
1999-10-03 10:41:40 +00:00
Marcel Moolenaar
3cf3c5d9dd sigset_t change (part 5 of 5)
-----------------------------

Most of the userland changes are in libc. For both the alpha
and the i386 setjmp has been changed to accomodate for the
new sigset_t. Internally, libc is mostly rewritten to use the
new syscalls. The exception is in compat-43/sigcompat.c

The POSIX thread library has also been rewritten to use the
new sigset_t. Except, that it currently only handles NSIG
signals instead of the maximum _SIG_MAXSIG. This should not
be a problem because current applications don't use any
signals higher than NSIG.

There are version bumps for the following libraries:
  libdialog
  libreadline
  libc
  libc_r
  libedit
  libftpio
  libss

These libraries either a) have one of the modified structures
visible in the interface, or b) use sigset_t internally and
may cause breakage if new binaries are used against libraries
that don't have the sigset_t change. This not an immediate
issue, but will be as soon as applications start using the
new range to its fullest.

NOTE: libncurses already had an version bump and has not been
      given one now.

NOTE: doscmd is a real casualty and has been disconnected for
      the moment. Reconnection will eventually happen after
      doscmd has been fixed. I'm aware that being the last one
      to touch it, I'm automaticly promoted to being maintainer.
      According to good taste this means that I will receive a
      badge which either will be glued or mechanically stapled,
      drilled or otherwise violently forced onto me :-)

NOTE: pcvt/vttest cannot be compiled with -traditional. The
      change cause sys/types to be included along the way which
      contains the const and volatile modifiers. I don't consider
      this a solution, but more a workaround.
1999-09-29 15:18:46 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Matthew N. Dodd
70ff7ab750 Fix MLINKS.
Noticed by: Norman C. Rice <nrice@emu.sourcee.com>
1999-08-20 17:37:22 +00:00
Matthew N. Dodd
90cc1fbc53 Add 2 functions: el_data_set() and el_data_get() which do what you
would expect.  (Allow user data to be associated with an EditLine context).

As this changes no existing interfaces and doesn't alter any structs
visable to the user I've been told that its not necessary to bump
the version of the library.
1999-08-20 01:17:12 +00:00
Nik Clayton
fbc400a67a Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

     .\"    $Id$
     .\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by:            bde
1999-07-12 20:50:10 +00:00
John Polstra
f92bdbd010 Switch to using ".So" as the extension for PIC object files rather
than ".so".  The old extension conflicted with well-established
naming conventions for dynamically loadable modules.

The "clean" targets continue to remove ".so" files too, to deal with
old systems.
1999-01-09 21:51:00 +00:00
Doug Rabson
3e0f4b28d6 On the alpha, sizeof(char*) != sizeof(int) which was assumed in
term_init().  This is the cause of /usr/bin/ftp faulting on the alpha.

Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
1998-11-30 10:12:03 +00:00
Warner Losh
e8420087b0 Replace memory leaking instances of realloc with non-leaking reallocf.
In some cases replace if (a == null) a = malloc(x); else a =
realloc(a, x); with simple reallocf(a, x).  Per ANSI-C, this is
guaranteed to be the same thing.

I've been running these on my system here w/o ill effects for some
time.  However, the CTM-express is at part 6 of 34 for the CAM
changes, so I've not been able to do a build world with the CAM in the
tree with these changes.  Shouldn't impact anything, but...
1998-09-16 04:17:47 +00:00
Bruce Evans
65a87ccc7c Fixed print format errors. 1998-06-30 18:03:05 +00:00
Brian Somers
10d9142685 Fixes assorted problems with the history edit functions in libedit. This
affects sh, ftp (and others?).

Submitted by: Max Euston <meuston@jmrodgers.com>
PR:           6516
1998-06-27 16:10:40 +00:00