svn commit: r296435 - in head/lib/libedit: . TEST edit/readline
Pedro F. Giffuni
pfg at FreeBSD.org
Sun Mar 6 21:32:57 UTC 2016
Author: pfg
Date: Sun Mar 6 21:32:54 2016
New Revision: 296435
URL: https://svnweb.freebsd.org/changeset/base/296435
Log:
Revert r296175
Undo update of libedit 2016-02-27
Something in libedit appears to be causing breakage in lldb38.
The changes are not generally huge but they are suficient to
to justify reverting for now.
Reported by: novel, bapt
Modified:
head/lib/libedit/Makefile
head/lib/libedit/TEST/tc1.c
head/lib/libedit/TEST/wtc1.c
head/lib/libedit/chared.c
head/lib/libedit/chared.h
head/lib/libedit/chartype.c
head/lib/libedit/chartype.h
head/lib/libedit/common.c
head/lib/libedit/config.h
head/lib/libedit/edit/readline/readline.h
head/lib/libedit/editline.3
head/lib/libedit/el.c
head/lib/libedit/el.h
head/lib/libedit/eln.c
head/lib/libedit/emacs.c
head/lib/libedit/filecomplete.c
head/lib/libedit/hist.c
head/lib/libedit/hist.h
head/lib/libedit/histedit.h
head/lib/libedit/history.c
head/lib/libedit/keymacro.c
head/lib/libedit/makelist
head/lib/libedit/map.c
head/lib/libedit/parse.c
head/lib/libedit/prompt.c
head/lib/libedit/prompt.h
head/lib/libedit/read.c
head/lib/libedit/read.h
head/lib/libedit/readline.c
head/lib/libedit/refresh.c
head/lib/libedit/refresh.h
head/lib/libedit/search.c
head/lib/libedit/search.h
head/lib/libedit/sig.c
head/lib/libedit/sig.h
head/lib/libedit/sys.h
head/lib/libedit/terminal.c
head/lib/libedit/terminal.h
head/lib/libedit/tokenizer.c
head/lib/libedit/tty.c
head/lib/libedit/tty.h
head/lib/libedit/vi.c
Directory Properties:
head/lib/libedit/ (props changed)
head/lib/libedit/edit/readline/ (props changed)
Modified: head/lib/libedit/Makefile
==============================================================================
--- head/lib/libedit/Makefile Sun Mar 6 18:41:48 2016 (r296434)
+++ head/lib/libedit/Makefile Sun Mar 6 21:32:54 2016 (r296435)
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.55 2016/02/24 14:25:38 christos Exp $
+# $NetBSD: Makefile,v 1.37 2009/01/18 12:17:49 lukem Exp $
# @(#)Makefile 8.1 (Berkeley) 6/4/93
# $FreeBSD$
@@ -6,7 +6,7 @@ LIB= edit
SHLIB_MAJOR= 7
SHLIBDIR?= /lib
-OSRCS= chared.c common.c el.c eln.c emacs.c fcns.c filecomplete.c help.c \
+OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \
hist.c keymacro.c map.c chartype.c \
parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c
@@ -34,6 +34,7 @@ CLEANFILES+= common.h editline.c emacs.h
INCS= histedit.h
+OSRCS+= eln.c
SRCS+= tokenizern.c historyn.c
CLEANFILES+= tokenizern.c historyn.c
CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/edit -DWIDECHAR
Modified: head/lib/libedit/TEST/tc1.c
==============================================================================
--- head/lib/libedit/TEST/tc1.c Sun Mar 6 18:41:48 2016 (r296434)
+++ head/lib/libedit/TEST/tc1.c Sun Mar 6 21:32:54 2016 (r296435)
@@ -1,4 +1,4 @@
-/* $NetBSD: tc1.c,v 1.7 2016/02/17 19:47:49 christos Exp $ */
+/* $NetBSD: tc1.c,v 1.6 2014/06/18 20:12:15 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 19
#if 0
static char sccsid[] = "@(#)test.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: tc1.c,v 1.7 2016/02/17 19:47:49 christos Exp $");
+__RCSID("$NetBSD: tc1.c,v 1.6 2014/06/18 20:12:15 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
__FBSDID("$FreeBSD$");
@@ -50,15 +50,15 @@ __FBSDID("$FreeBSD$");
/*
* test.c: A little test program
*/
+#include <stdio.h>
+#include <string.h>
+#include <signal.h>
#include <sys/wait.h>
#include <ctype.h>
-#include <dirent.h>
-#include <locale.h>
-#include <signal.h>
-#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
+#include <dirent.h>
+#include <locale.h>
#include "histedit.h"
@@ -158,7 +158,7 @@ main(int argc, char *argv[])
/* Add a user-defined function */
el_set(el, EL_ADDFN, "ed-complete", "Complete argument", complete);
- /* Bind tab to it */
+ /* Bind tab to it */
el_set(el, EL_BIND, "^I", "ed-complete", NULL);
/*
Modified: head/lib/libedit/TEST/wtc1.c
==============================================================================
--- head/lib/libedit/TEST/wtc1.c Sun Mar 6 18:41:48 2016 (r296434)
+++ head/lib/libedit/TEST/wtc1.c Sun Mar 6 21:32:54 2016 (r296435)
@@ -5,16 +5,13 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <signal.h>
#include <sys/wait.h>
+#include <err.h>
#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
#include <dirent.h>
-#include <err.h>
#include <limits.h>
#include <locale.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
#include "../histedit.h"
Modified: head/lib/libedit/chared.c
==============================================================================
--- head/lib/libedit/chared.c Sun Mar 6 18:41:48 2016 (r296434)
+++ head/lib/libedit/chared.c Sun Mar 6 21:32:54 2016 (r296435)
@@ -1,4 +1,4 @@
-/* $NetBSD: chared.c,v 1.49 2016/02/24 14:29:21 christos Exp $ */
+/* $NetBSD: chared.c,v 1.40 2014/06/18 18:12:28 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: chared.c,v 1.49 2016/02/24 14:29:21 christos Exp $");
+__RCSID("$NetBSD: chared.c,v 1.40 2014/06/18 18:12:28 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
@@ -46,12 +46,8 @@ __FBSDID("$FreeBSD$");
/*
* chared.c: Character editor utilities
*/
-#include <ctype.h>
#include <stdlib.h>
-#include <string.h>
-
#include "el.h"
-#include "common.h"
private void ch__clearmacro (EditLine *);
@@ -205,7 +201,7 @@ c_delbefore1(EditLine *el)
* Return if p is part of a word according to emacs
*/
protected int
-ce__isword(wint_t p)
+ce__isword(Int p)
{
return Isalnum(p) || Strchr(STR("*?_-.[]~="), p) != NULL;
}
@@ -215,7 +211,7 @@ ce__isword(wint_t p)
* Return if p is part of a word according to vi
*/
protected int
-cv__isword(wint_t p)
+cv__isword(Int p)
{
if (Isalnum(p) || p == '_')
return 1;
@@ -229,7 +225,7 @@ cv__isword(wint_t p)
* Return if p is part of a big word according to vi
*/
protected int
-cv__isWord(wint_t p)
+cv__isWord(Int p)
{
return !Isspace(p);
}
@@ -239,7 +235,7 @@ cv__isWord(wint_t p)
* Find the previous word
*/
protected Char *
-c__prev_word(Char *p, Char *low, int n, int (*wtest)(wint_t))
+c__prev_word(Char *p, Char *low, int n, int (*wtest)(Int))
{
p--;
@@ -263,7 +259,7 @@ c__prev_word(Char *p, Char *low, int n,
* Find the next word
*/
protected Char *
-c__next_word(Char *p, Char *high, int n, int (*wtest)(wint_t))
+c__next_word(Char *p, Char *high, int n, int (*wtest)(Int))
{
while (n--) {
while ((p < high) && !(*wtest)(*p))
@@ -281,7 +277,7 @@ c__next_word(Char *p, Char *high, int n,
* Find the next word vi style
*/
protected Char *
-cv_next_word(EditLine *el, Char *p, Char *high, int n, int (*wtest)(wint_t))
+cv_next_word(EditLine *el, Char *p, Char *high, int n, int (*wtest)(Int))
{
int test;
@@ -310,7 +306,7 @@ cv_next_word(EditLine *el, Char *p, Char
* Find the previous word vi style
*/
protected Char *
-cv_prev_word(Char *p, Char *low, int n, int (*wtest)(wint_t))
+cv_prev_word(Char *p, Char *low, int n, int (*wtest)(Int))
{
int test;
@@ -374,7 +370,7 @@ cv_delfini(EditLine *el)
* Go to the end of this word according to vi
*/
protected Char *
-cv__endword(Char *p, Char *high, int n, int (*wtest)(wint_t))
+cv__endword(Char *p, Char *high, int n, int (*wtest)(Int))
{
int test;
@@ -528,7 +524,7 @@ ch_enlargebufs(EditLine *el, size_t addl
/* zero the newly added memory, leave old data in */
(void) memset(&newbuffer[sz], 0, (newsz - sz) * sizeof(*newbuffer));
-
+
oldbuf = el->el_line.buffer;
el->el_line.buffer = newbuffer;
@@ -577,7 +573,7 @@ ch_enlargebufs(EditLine *el, size_t addl
el->el_chared.c_redo.lim = newbuffer +
(el->el_chared.c_redo.lim - el->el_chared.c_redo.buf);
el->el_chared.c_redo.buf = newbuffer;
-
+
if (!hist_enlargebuf(el, sz, newsz))
return 0;
@@ -677,9 +673,9 @@ out:
protected int
c_gets(EditLine *el, Char *buf, const Char *prompt)
{
- wchar_t wch;
+ Char ch;
ssize_t len;
- Char *cp = el->el_line.buffer, ch;
+ Char *cp = el->el_line.buffer;
if (prompt) {
len = (ssize_t)Strlen(prompt);
@@ -694,28 +690,26 @@ c_gets(EditLine *el, Char *buf, const Ch
el->el_line.lastchar = cp + 1;
re_refresh(el);
- if (el_wgetc(el, &wch) != 1) {
+ if (FUN(el,getc)(el, &ch) != 1) {
ed_end_of_file(el, 0);
len = -1;
break;
}
- ch = (Char)wch;
switch (ch) {
- case L'\b': /* Delete and backspace */
+ case 0010: /* Delete and backspace */
case 0177:
if (len == 0) {
len = -1;
break;
}
- len--;
cp--;
continue;
case 0033: /* ESC */
- case L'\r': /* Newline */
- case L'\n':
+ case '\r': /* Newline */
+ case '\n':
buf[len] = ch;
break;
Modified: head/lib/libedit/chared.h
==============================================================================
--- head/lib/libedit/chared.h Sun Mar 6 18:41:48 2016 (r296434)
+++ head/lib/libedit/chared.h Sun Mar 6 21:32:54 2016 (r296435)
@@ -1,4 +1,4 @@
-/* $NetBSD: chared.h,v 1.27 2016/02/16 22:53:14 christos Exp $ */
+/* $NetBSD: chared.h,v 1.22 2014/06/18 18:12:28 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -41,6 +41,11 @@
#ifndef _h_el_chared
#define _h_el_chared
+#include <ctype.h>
+#include <string.h>
+
+#include "histedit.h"
+
#define EL_MAXMACRO 10
/*
@@ -135,18 +140,24 @@ typedef struct el_chared_t {
#define MODE_REPLACE 1
#define MODE_REPLACE_1 2
+#include "common.h"
+#include "vi.h"
+#include "emacs.h"
+#include "search.h"
+#include "fcns.h"
+
-protected int cv__isword(wint_t);
-protected int cv__isWord(wint_t);
+protected int cv__isword(Int);
+protected int cv__isWord(Int);
protected void cv_delfini(EditLine *);
-protected Char *cv__endword(Char *, Char *, int, int (*)(wint_t));
-protected int ce__isword(wint_t);
+protected Char *cv__endword(Char *, Char *, int, int (*)(Int));
+protected int ce__isword(Int);
protected void cv_undo(EditLine *);
protected void cv_yank(EditLine *, const Char *, int);
-protected Char *cv_next_word(EditLine*, Char *, Char *, int, int (*)(wint_t));
-protected Char *cv_prev_word(Char *, Char *, int, int (*)(wint_t));
-protected Char *c__next_word(Char *, Char *, int, int (*)(wint_t));
-protected Char *c__prev_word(Char *, Char *, int, int (*)(wint_t));
+protected Char *cv_next_word(EditLine*, Char *, Char *, int, int (*)(Int));
+protected Char *cv_prev_word(Char *, Char *, int, int (*)(Int));
+protected Char *c__next_word(Char *, Char *, int, int (*)(Int));
+protected Char *c__prev_word(Char *, Char *, int, int (*)(Int));
protected void c_insert(EditLine *, int);
protected void c_delbefore(EditLine *, int);
protected void c_delbefore1(EditLine *);
Modified: head/lib/libedit/chartype.c
==============================================================================
--- head/lib/libedit/chartype.c Sun Mar 6 18:41:48 2016 (r296434)
+++ head/lib/libedit/chartype.c Sun Mar 6 21:32:54 2016 (r296435)
@@ -1,4 +1,4 @@
-/* $NetBSD: chartype.c,v 1.23 2016/02/28 23:02:24 christos Exp $ */
+/* $NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -31,16 +31,13 @@
*/
#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: chartype.c,v 1.23 2016/02/28 23:02:24 christos Exp $");
+__RCSID("$NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $");
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "el.h"
+#include <stdlib.h>
#define CT_BUFSIZ ((size_t)1024)
@@ -71,7 +68,7 @@ ct_conv_wbuff_resize(ct_buffer_t *conv,
{
void *p;
- if (wsize <= conv->wsize)
+ if (wsize <= conv->wsize)
return 0;
conv->wsize = wsize;
@@ -209,28 +206,6 @@ ct_encode_char(char *dst, size_t len, Ch
}
return l;
}
-
-size_t
-ct_mbrtowc(wchar_t *wc, const char *s, size_t n)
-{
- mbstate_t mbs;
- /* This only works because UTF-8 is stateless */
- memset(&mbs, 0, sizeof(mbs));
- return mbrtowc(wc, s, n, &mbs);
-}
-
-#else
-
-size_t
-ct_mbrtowc(wchar_t *wc, const char *s, size_t n)
- if (s == NULL)
- return 0;
- if (n == 0)
- return (size_t)-2;
- if (wc != NULL)
- *wc = *s;
- return *s != '\0';
-}
#endif
protected const Char *
@@ -354,7 +329,7 @@ ct_visual_char(Char *dst, size_t len, Ch
return c > 0xffff ? 8 : 7;
#else
*dst++ = '\\';
-#define tooctaldigit(v) (Char)((v) + '0')
+#define tooctaldigit(v) ((v) + '0')
*dst++ = tooctaldigit(((unsigned int) c >> 6) & 0x7);
*dst++ = tooctaldigit(((unsigned int) c >> 3) & 0x7);
*dst++ = tooctaldigit(((unsigned int) c ) & 0x7);
Modified: head/lib/libedit/chartype.h
==============================================================================
--- head/lib/libedit/chartype.h Sun Mar 6 18:41:48 2016 (r296434)
+++ head/lib/libedit/chartype.h Sun Mar 6 21:32:54 2016 (r296435)
@@ -1,4 +1,4 @@
-/* $NetBSD: chartype.h,v 1.23 2016/02/24 17:20:01 christos Exp $ */
+/* $NetBSD: chartype.h,v 1.15 2015/05/17 13:14:41 christos Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -32,6 +32,7 @@
#define _h_chartype_f
+
#ifdef WIDECHAR
/* Ideally we should also test the value of the define to see if it
@@ -54,18 +55,21 @@
#warning Build environment does not support non-BMP characters
#endif
-#define ct_wctob wctob
+#define ct_mbtowc mbtowc
+#define ct_mbtowc_reset mbtowc(0,0,(size_t)0)
#define ct_wctomb wctomb
#define ct_wctomb_reset wctomb(0,0)
#define ct_wcstombs wcstombs
#define ct_mbstowcs mbstowcs
#define Char wchar_t
+#define Int wint_t
#define FUN(prefix,rest) prefix ## _w ## rest
#define FUNW(type) type ## _w
#define TYPE(type) type ## W
+#define FCHAR "%lc"
#define FSTR "%ls"
-#define STR(x) L ## x
+#define STR(x) L ## x
#define UC(c) c
#define Isalpha(x) iswalpha(x)
#define Isalnum(x) iswalnum(x)
@@ -106,18 +110,21 @@ Width(wchar_t c)
#else /* NARROW */
-#define ct_wctob(w) ((int)(w))
+#define ct_mbtowc error
+#define ct_mbtowc_reset
#define ct_wctomb error
-#define ct_wctomb_reset
+#define ct_wctomb_reset
#define ct_wcstombs(a, b, c) (strncpy(a, b, c), strlen(a))
#define ct_mbstowcs(a, b, c) (strncpy(a, b, c), strlen(a))
#define Char char
+#define Int int
#define FUN(prefix,rest) prefix ## _ ## rest
#define FUNW(type) type
#define TYPE(type) type
+#define FCHAR "%c"
#define FSTR "%s"
-#define STR(x) x
+#define STR(x) x
#define UC(c) (unsigned char)(c)
#define Isalpha(x) isalpha((unsigned char)x)
@@ -206,7 +213,7 @@ protected size_t ct_enc_width(Char);
#define VISUAL_WIDTH_MAX ((size_t)8)
/* The terminal is thought of in terms of X columns by Y lines. In the cases
- * where a wide character takes up more than one column, the adjacent
+ * where a wide character takes up more than one column, the adjacent
* occupied column entries will contain this faux character. */
#define MB_FILL_CHAR ((Char)-1)
@@ -238,7 +245,5 @@ protected const Char *ct_visual_string(c
protected int ct_chr_class(Char c);
#endif
-size_t ct_mbrtowc(wchar_t *, const char *, size_t);
-
#endif /* _chartype_f */
Modified: head/lib/libedit/common.c
==============================================================================
--- head/lib/libedit/common.c Sun Mar 6 18:41:48 2016 (r296434)
+++ head/lib/libedit/common.c Sun Mar 6 21:32:54 2016 (r296435)
@@ -1,4 +1,4 @@
-/* $NetBSD: common.c,v 1.39 2016/02/24 14:25:38 christos Exp $ */
+/* $NetBSD: common.c,v 1.29 2012/03/24 20:08:43 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: common.c,v 1.39 2016/02/24 14:25:38 christos Exp $");
+__RCSID("$NetBSD: common.c,v 1.29 2012/03/24 20:08:43 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
@@ -46,13 +46,7 @@ __FBSDID("$FreeBSD$");
/*
* common.c: Common Editor functions
*/
-#include <ctype.h>
-#include <string.h>
-
#include "el.h"
-#include "common.h"
-#include "parse.h"
-#include "vi.h"
/* ed_end_of_file():
* Indicate end of file
@@ -60,7 +54,7 @@ __FBSDID("$FreeBSD$");
*/
protected el_action_t
/*ARGSUSED*/
-ed_end_of_file(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_end_of_file(EditLine *el, Int c __attribute__((__unused__)))
{
re_goto_bottom(el);
@@ -74,7 +68,7 @@ ed_end_of_file(EditLine *el, wint_t c __
* Insert a character [bound to all insert keys]
*/
protected el_action_t
-ed_insert(EditLine *el, wint_t c)
+ed_insert(EditLine *el, Int c)
{
int count = el->el_state.argument;
@@ -93,14 +87,14 @@ ed_insert(EditLine *el, wint_t c)
|| el->el_line.cursor >= el->el_line.lastchar)
c_insert(el, 1);
- *el->el_line.cursor++ = (Char)c;
+ *el->el_line.cursor++ = c;
re_fastaddc(el); /* fast refresh for one char. */
} else {
if (el->el_state.inputmode != MODE_REPLACE_1)
c_insert(el, el->el_state.argument);
while (count-- && el->el_line.cursor < el->el_line.lastchar)
- *el->el_line.cursor++ = (Char)c;
+ *el->el_line.cursor++ = c;
re_refresh(el);
}
@@ -117,7 +111,7 @@ ed_insert(EditLine *el, wint_t c)
*/
protected el_action_t
/*ARGSUSED*/
-ed_delete_prev_word(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_delete_prev_word(EditLine *el, Int c __attribute__((__unused__)))
{
Char *cp, *p, *kp;
@@ -145,7 +139,7 @@ ed_delete_prev_word(EditLine *el, wint_t
*/
protected el_action_t
/*ARGSUSED*/
-ed_delete_next_char(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_delete_next_char(EditLine *el, Int c __attribute__((__unused__)))
{
#ifdef DEBUG_EDIT
#define EL el->el_line
@@ -192,7 +186,7 @@ ed_delete_next_char(EditLine *el, wint_t
*/
protected el_action_t
/*ARGSUSED*/
-ed_kill_line(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_kill_line(EditLine *el, Int c __attribute__((__unused__)))
{
Char *kp, *cp;
@@ -213,7 +207,7 @@ ed_kill_line(EditLine *el, wint_t c __at
*/
protected el_action_t
/*ARGSUSED*/
-ed_move_to_end(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_move_to_end(EditLine *el, Int c __attribute__((__unused__)))
{
el->el_line.cursor = el->el_line.lastchar;
@@ -236,7 +230,7 @@ ed_move_to_end(EditLine *el, wint_t c __
*/
protected el_action_t
/*ARGSUSED*/
-ed_move_to_beg(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_move_to_beg(EditLine *el, Int c __attribute__((__unused__)))
{
el->el_line.cursor = el->el_line.buffer;
@@ -259,7 +253,7 @@ ed_move_to_beg(EditLine *el, wint_t c __
* [^T] [^T]
*/
protected el_action_t
-ed_transpose_chars(EditLine *el, wint_t c)
+ed_transpose_chars(EditLine *el, Int c)
{
if (el->el_line.cursor < el->el_line.lastchar) {
@@ -272,7 +266,7 @@ ed_transpose_chars(EditLine *el, wint_t
/* must have at least two chars entered */
c = el->el_line.cursor[-2];
el->el_line.cursor[-2] = el->el_line.cursor[-1];
- el->el_line.cursor[-1] = (Char)c;
+ el->el_line.cursor[-1] = c;
return CC_REFRESH;
} else
return CC_ERROR;
@@ -285,7 +279,7 @@ ed_transpose_chars(EditLine *el, wint_t
*/
protected el_action_t
/*ARGSUSED*/
-ed_next_char(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_next_char(EditLine *el, Int c __attribute__((__unused__)))
{
Char *lim = el->el_line.lastchar;
@@ -314,7 +308,7 @@ ed_next_char(EditLine *el, wint_t c __at
*/
protected el_action_t
/*ARGSUSED*/
-ed_prev_word(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_prev_word(EditLine *el, Int c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.buffer)
@@ -340,7 +334,7 @@ ed_prev_word(EditLine *el, wint_t c __at
*/
protected el_action_t
/*ARGSUSED*/
-ed_prev_char(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_prev_char(EditLine *el, Int c __attribute__((__unused__)))
{
if (el->el_line.cursor > el->el_line.buffer) {
@@ -364,12 +358,14 @@ ed_prev_char(EditLine *el, wint_t c __at
* [^V] [^V]
*/
protected el_action_t
-ed_quoted_insert(EditLine *el, wint_t c)
+ed_quoted_insert(EditLine *el, Int c)
{
int num;
+ Char tc;
tty_quotemode(el);
- num = el_wgetc(el, &c);
+ num = FUN(el,getc)(el, &tc);
+ c = tc;
tty_noquotemode(el);
if (num == 1)
return ed_insert(el, c);
@@ -382,7 +378,7 @@ ed_quoted_insert(EditLine *el, wint_t c)
* Adds to argument or enters a digit
*/
protected el_action_t
-ed_digit(EditLine *el, wint_t c)
+ed_digit(EditLine *el, Int c)
{
if (!Isdigit(c))
@@ -410,7 +406,7 @@ ed_digit(EditLine *el, wint_t c)
* For ESC-n
*/
protected el_action_t
-ed_argument_digit(EditLine *el, wint_t c)
+ed_argument_digit(EditLine *el, Int c)
{
if (!Isdigit(c))
@@ -436,7 +432,7 @@ ed_argument_digit(EditLine *el, wint_t c
protected el_action_t
/*ARGSUSED*/
ed_unassigned(EditLine *el __attribute__((__unused__)),
- wint_t c __attribute__((__unused__)))
+ Int c __attribute__((__unused__)))
{
return CC_ERROR;
@@ -453,8 +449,8 @@ ed_unassigned(EditLine *el __attribute__
*/
protected el_action_t
/*ARGSUSED*/
-ed_tty_sigint(EditLine *el __attribute__((__unused__)),
- wint_t c __attribute__((__unused__)))
+ed_tty_sigint(EditLine *el __attribute__((__unused__)),
+ Int c __attribute__((__unused__)))
{
return CC_NORM;
@@ -467,8 +463,8 @@ ed_tty_sigint(EditLine *el __attribute__
*/
protected el_action_t
/*ARGSUSED*/
-ed_tty_dsusp(EditLine *el __attribute__((__unused__)),
- wint_t c __attribute__((__unused__)))
+ed_tty_dsusp(EditLine *el __attribute__((__unused__)),
+ Int c __attribute__((__unused__)))
{
return CC_NORM;
@@ -481,8 +477,8 @@ ed_tty_dsusp(EditLine *el __attribute__(
*/
protected el_action_t
/*ARGSUSED*/
-ed_tty_flush_output(EditLine *el __attribute__((__unused__)),
- wint_t c __attribute__((__unused__)))
+ed_tty_flush_output(EditLine *el __attribute__((__unused__)),
+ Int c __attribute__((__unused__)))
{
return CC_NORM;
@@ -495,8 +491,8 @@ ed_tty_flush_output(EditLine *el __attri
*/
protected el_action_t
/*ARGSUSED*/
-ed_tty_sigquit(EditLine *el __attribute__((__unused__)),
- wint_t c __attribute__((__unused__)))
+ed_tty_sigquit(EditLine *el __attribute__((__unused__)),
+ Int c __attribute__((__unused__)))
{
return CC_NORM;
@@ -509,8 +505,8 @@ ed_tty_sigquit(EditLine *el __attribute_
*/
protected el_action_t
/*ARGSUSED*/
-ed_tty_sigtstp(EditLine *el __attribute__((__unused__)),
- wint_t c __attribute__((__unused__)))
+ed_tty_sigtstp(EditLine *el __attribute__((__unused__)),
+ Int c __attribute__((__unused__)))
{
return CC_NORM;
@@ -523,8 +519,8 @@ ed_tty_sigtstp(EditLine *el __attribute_
*/
protected el_action_t
/*ARGSUSED*/
-ed_tty_stop_output(EditLine *el __attribute__((__unused__)),
- wint_t c __attribute__((__unused__)))
+ed_tty_stop_output(EditLine *el __attribute__((__unused__)),
+ Int c __attribute__((__unused__)))
{
return CC_NORM;
@@ -537,8 +533,8 @@ ed_tty_stop_output(EditLine *el __attrib
*/
protected el_action_t
/*ARGSUSED*/
-ed_tty_start_output(EditLine *el __attribute__((__unused__)),
- wint_t c __attribute__((__unused__)))
+ed_tty_start_output(EditLine *el __attribute__((__unused__)),
+ Int c __attribute__((__unused__)))
{
return CC_NORM;
@@ -551,7 +547,7 @@ ed_tty_start_output(EditLine *el __attri
*/
protected el_action_t
/*ARGSUSED*/
-ed_newline(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_newline(EditLine *el, Int c __attribute__((__unused__)))
{
re_goto_bottom(el);
@@ -567,7 +563,7 @@ ed_newline(EditLine *el, wint_t c __attr
*/
protected el_action_t
/*ARGSUSED*/
-ed_delete_prev_char(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_delete_prev_char(EditLine *el, Int c __attribute__((__unused__)))
{
if (el->el_line.cursor <= el->el_line.buffer)
@@ -587,7 +583,7 @@ ed_delete_prev_char(EditLine *el, wint_t
*/
protected el_action_t
/*ARGSUSED*/
-ed_clear_screen(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_clear_screen(EditLine *el, Int c __attribute__((__unused__)))
{
terminal_clear_screen(el); /* clear the whole real screen */
@@ -602,8 +598,8 @@ ed_clear_screen(EditLine *el, wint_t c _
*/
protected el_action_t
/*ARGSUSED*/
-ed_redisplay(EditLine *el __attribute__((__unused__)),
- wint_t c __attribute__((__unused__)))
+ed_redisplay(EditLine *el __attribute__((__unused__)),
+ Int c __attribute__((__unused__)))
{
return CC_REDISPLAY;
@@ -616,7 +612,7 @@ ed_redisplay(EditLine *el __attribute__(
*/
protected el_action_t
/*ARGSUSED*/
-ed_start_over(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_start_over(EditLine *el, Int c __attribute__((__unused__)))
{
ch_reset(el, 0);
@@ -630,8 +626,8 @@ ed_start_over(EditLine *el, wint_t c __a
*/
protected el_action_t
/*ARGSUSED*/
-ed_sequence_lead_in(EditLine *el __attribute__((__unused__)),
- wint_t c __attribute__((__unused__)))
+ed_sequence_lead_in(EditLine *el __attribute__((__unused__)),
+ Int c __attribute__((__unused__)))
{
return CC_NORM;
@@ -644,7 +640,7 @@ ed_sequence_lead_in(EditLine *el __attri
*/
protected el_action_t
/*ARGSUSED*/
-ed_prev_history(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_prev_history(EditLine *el, Int c __attribute__((__unused__)))
{
char beep = 0;
int sv_event = el->el_history.eventno;
@@ -664,6 +660,7 @@ ed_prev_history(EditLine *el, wint_t c _
if (hist_get(el) == CC_ERROR) {
if (el->el_map.type == MAP_VI) {
el->el_history.eventno = sv_event;
+
}
beep = 1;
/* el->el_history.eventno was fixed by first call */
@@ -681,7 +678,7 @@ ed_prev_history(EditLine *el, wint_t c _
*/
protected el_action_t
/*ARGSUSED*/
-ed_next_history(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_next_history(EditLine *el, Int c __attribute__((__unused__)))
{
el_action_t beep = CC_REFRESH, rval;
@@ -708,11 +705,11 @@ ed_next_history(EditLine *el, wint_t c _
*/
protected el_action_t
/*ARGSUSED*/
-ed_search_prev_history(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_search_prev_history(EditLine *el, Int c __attribute__((__unused__)))
{
const Char *hp;
int h;
- int found = 0;
+ bool_t found = 0;
el->el_chared.c_vcmd.action = NOP;
el->el_chared.c_undo.len = -1;
@@ -751,7 +748,7 @@ ed_search_prev_history(EditLine *el, win
(el->el_line.lastchar - el->el_line.buffer)) ||
hp[el->el_line.lastchar - el->el_line.buffer]) &&
c_hmatch(el, hp)) {
- found = 1;
+ found++;
break;
}
h++;
@@ -776,11 +773,11 @@ ed_search_prev_history(EditLine *el, win
*/
protected el_action_t
/*ARGSUSED*/
-ed_search_next_history(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_search_next_history(EditLine *el, Int c __attribute__((__unused__)))
{
const Char *hp;
int h;
- int found = 0;
+ bool_t found = 0;
el->el_chared.c_vcmd.action = NOP;
el->el_chared.c_undo.len = -1;
@@ -830,7 +827,7 @@ ed_search_next_history(EditLine *el, win
*/
protected el_action_t
/*ARGSUSED*/
-ed_prev_line(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_prev_line(EditLine *el, Int c __attribute__((__unused__)))
{
Char *ptr;
int nchars = c_hpos(el);
@@ -873,7 +870,7 @@ ed_prev_line(EditLine *el, wint_t c __at
*/
protected el_action_t
/*ARGSUSED*/
-ed_next_line(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_next_line(EditLine *el, Int c __attribute__((__unused__)))
{
Char *ptr;
int nchars = c_hpos(el);
@@ -907,7 +904,7 @@ ed_next_line(EditLine *el, wint_t c __at
*/
protected el_action_t
/*ARGSUSED*/
-ed_command(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_command(EditLine *el, Int c __attribute__((__unused__)))
{
Char tmpbuf[EL_BUFSIZ];
int tmplen;
Modified: head/lib/libedit/config.h
==============================================================================
--- head/lib/libedit/config.h Sun Mar 6 18:41:48 2016 (r296434)
+++ head/lib/libedit/config.h Sun Mar 6 21:32:54 2016 (r296435)
@@ -21,8 +21,8 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
-/* Define to 1 if you have the `getline' function. */
-#define HAVE_GETLINE 1
+/* Define to 1 if you have the `fgetln' function. */
+#define HAVE_FGETLN 1
/* Define to 1 if you have the `fork' function. */
#define HAVE_FORK 1
@@ -188,6 +188,9 @@
/* Define to 1 if you have the `vis' function. */
#define HAVE_VIS 1
+/* Define to 1 if you have the `wcsdup' function. */
+#define HAVE_WCSDUP 1
+
/* Define to 1 if `fork' works. */
#define HAVE_WORKING_FORK 1
@@ -254,9 +257,6 @@
/* Version number of package */
#define VERSION "3.0"
-/* Define to 1 if the system provides the SIZE_MAX constant */
-#define HAVE_SIZE_MAX 1
-
/* Define to 1 if you want wide-character code */
/* #undef WIDECHAR */
Modified: head/lib/libedit/edit/readline/readline.h
==============================================================================
--- head/lib/libedit/edit/readline/readline.h Sun Mar 6 18:41:48 2016 (r296434)
+++ head/lib/libedit/edit/readline/readline.h Sun Mar 6 21:32:54 2016 (r296435)
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.h,v 1.39 2016/02/17 19:47:49 christos Exp $ */
+/* $NetBSD: readline.h,v 1.37 2015/06/02 15:36:45 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@ typedef void *histdata_t;
typedef struct _hist_entry {
const char *line;
- histdata_t data;
+ histdata_t data;
} HIST_ENTRY;
typedef struct _keymap_entry {
@@ -89,7 +89,7 @@ typedef KEYMAP_ENTRY *Keymap;
#define RUBOUT 0x7f
#define ABORT_CHAR CTRL('G')
-#define RL_READLINE_VERSION 0x0402
+#define RL_READLINE_VERSION 0x0402
#define RL_PROMPT_START_IGNORE '\1'
#define RL_PROMPT_END_IGNORE '\2'
@@ -98,7 +98,7 @@ typedef KEYMAP_ENTRY *Keymap;
extern "C" {
#endif
extern const char *rl_library_version;
-extern int rl_readline_version;
+extern int rl_readline_version;
extern char *rl_readline_name;
extern FILE *rl_instream;
extern FILE *rl_outstream;
@@ -199,10 +199,10 @@ int rl_add_defun(const char *, rl_comm
HISTORY_STATE *history_get_history_state(void);
void rl_get_screen_size(int *, int *);
void rl_set_screen_size(int, int);
-char *rl_filename_completion_function (const char *, int);
+char *rl_filename_completion_function (const char *, int);
int _rl_abort_internal(void);
int _rl_qsort_string_compare(char **, char **);
-char **rl_completion_matches(const char *, rl_compentry_func_t *);
+char **rl_completion_matches(const char *, rl_compentry_func_t *);
void rl_forced_update_display(void);
int rl_set_prompt(const char *);
int rl_on_new_line(void);
@@ -218,8 +218,6 @@ int rl_generic_bind(int, const char *,
int rl_bind_key_in_map(int, rl_command_func_t *, Keymap);
void rl_cleanup_after_signal(void);
void rl_free_line_state(void);
-int rl_set_keyboard_input_timeout(int);
-
#ifdef __cplusplus
}
#endif
Modified: head/lib/libedit/editline.3
==============================================================================
--- head/lib/libedit/editline.3 Sun Mar 6 18:41:48 2016 (r296434)
+++ head/lib/libedit/editline.3 Sun Mar 6 21:32:54 2016 (r296435)
@@ -1,4 +1,4 @@
-.\" $NetBSD: editline.3,v 1.88 2016/02/25 14:59:22 wiz Exp $
+.\" $NetBSD: editline.3,v 1.85 2015/11/03 21:36:59 christos Exp $
.\"
.\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 24, 2016
+.Dd November 3, 2015
.Dt EDITLINE 3
.Os
.Sh NAME
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-all
mailing list