summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libedit/Makefile7
-rw-r--r--lib/libedit/TEST/Makefile8
-rw-r--r--lib/libedit/chartype.c36
-rw-r--r--lib/libedit/chartype.h43
-rw-r--r--lib/libedit/el.c10
-rw-r--r--lib/libedit/el.h6
-rw-r--r--lib/libedit/eln.c4
-rw-r--r--lib/libedit/hist.c6
-rw-r--r--lib/libedit/hist.h11
-rw-r--r--lib/libedit/history.c6
-rw-r--r--lib/libedit/keymacro.c6
-rw-r--r--lib/libedit/makelist1
-rw-r--r--lib/libedit/read.c42
-rw-r--r--lib/libedit/readline.c4
-rw-r--r--lib/libedit/search.c6
-rw-r--r--lib/libedit/sys.h7
-rw-r--r--lib/libedit/terminal.c8
17 files changed, 27 insertions, 184 deletions
diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile
index 29527ef0b74..0d29caa656b 100644
--- a/lib/libedit/Makefile
+++ b/lib/libedit/Makefile
@@ -1,11 +1,9 @@
-# $OpenBSD: Makefile,v 1.19 2016/03/30 06:38:42 jmc Exp $
+# $OpenBSD: Makefile,v 1.20 2016/04/09 19:31:55 schwarze Exp $
# $NetBSD: Makefile,v 1.41 2010/02/03 15:34:43 roy Exp $
# @(#)Makefile 8.1 (Berkeley) 6/4/93
LIB= edit
-WIDECHAR= yes
-
OSRCS= chared.c common.c el.c eln.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
@@ -17,11 +15,8 @@ MAN= editline.3 editrc.5
# For protection
SRCS= editline.c tokenizer.c history.c readline.c
-.if "${WIDECHAR}" == "yes"
SRCS+= tokenizern.c historyn.c
CLEANFILES+=tokenizern.c.tmp tokenizern.c historyn.c.tmp historyn.c
-CPPFLAGS+=-DWIDECHAR
-.endif
LIBEDITDIR?=${.CURDIR}
diff --git a/lib/libedit/TEST/Makefile b/lib/libedit/TEST/Makefile
index e03e80c17f6..2d25fdf09ea 100644
--- a/lib/libedit/TEST/Makefile
+++ b/lib/libedit/TEST/Makefile
@@ -1,16 +1,10 @@
-# $OpenBSD: Makefile,v 1.3 2016/03/20 22:20:17 schwarze Exp $
+# $OpenBSD: Makefile,v 1.4 2016/04/09 19:31:55 schwarze Exp $
# $NetBSD: Makefile,v 1.5 2010/02/03 15:34:43 roy Exp $
-WIDECHAR= yes
-
NOMAN=1
PROG=tc1
CPPFLAGS=-I${.CURDIR}/..
LDADD+=-ledit -ltermcap
DPADD+=${LIBEDIT} ${LIBTERMCAP}
-.if "${WIDECHAR}" == "yes"
-CPPFLAGS+=-DWIDECHAR
-.endif
-
.include <bsd.prog.mk>
diff --git a/lib/libedit/chartype.c b/lib/libedit/chartype.c
index 5c1ef1110a2..ee8717a6937 100644
--- a/lib/libedit/chartype.c
+++ b/lib/libedit/chartype.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chartype.c,v 1.10 2016/03/21 18:40:25 schwarze Exp $ */
+/* $OpenBSD: chartype.c,v 1.11 2016/04/09 19:31:55 schwarze Exp $ */
/* $NetBSD: chartype.c,v 1.6 2011/07/28 00:48:21 christos Exp $ */
/*-
@@ -40,7 +40,6 @@
#define CT_BUFSIZ 1024
-#ifdef WIDECHAR
protected void
ct_conv_buff_resize(ct_buffer_t *conv, size_t mincsize, size_t minwsize)
{
@@ -198,22 +197,6 @@ ct_encode_char(char *dst, size_t len, Char c)
return l;
}
-#else
-
-size_t
-/*ARGSUSED*/
-ct_mbrtowc(wchar_t *wc, const char *s, size_t n,
- void *mbs __attribute__((__unused__))) {
- if (s == NULL)
- return 0;
- if (n == 0)
- return (size_t)-2;
- if (wc != NULL)
- *wc = *s;
- return *s != '\0';
-}
-#endif
-
protected const Char *
ct_visual_string(const Char *s)
{
@@ -268,9 +251,7 @@ protected int
ct_visual_width(Char c)
{
int t = ct_chr_class(c);
-#ifdef WIDECHAR
int w;
-#endif
switch (t) {
case CHTYPE_ASCIICTL:
return 2; /* ^@ ^? etc. */
@@ -278,7 +259,6 @@ ct_visual_width(Char c)
return 1; /* Hmm, this really need to be handled outside! */
case CHTYPE_NL:
return 0; /* Should this be 1 instead? */
-#ifdef WIDECHAR
case CHTYPE_PRINT:
w = wcwidth(c);
return (w == -1 ? 0 : w);
@@ -287,12 +267,6 @@ ct_visual_width(Char c)
return 8; /* \U+12345 */
else
return 7; /* \U+1234 */
-#else
- case CHTYPE_PRINT:
- return 1;
- case CHTYPE_NONPRINT:
- return 4; /* \123 */
-#endif
default:
return 0; /* should not happen */
}
@@ -325,7 +299,6 @@ ct_visual_char(Char *dst, size_t len, Char c)
* so this is right */
if ((ssize_t)len < ct_visual_width(c))
return -1; /* insufficient space */
-#ifdef WIDECHAR
*dst++ = '\\';
*dst++ = 'U';
*dst++ = '+';
@@ -337,13 +310,6 @@ ct_visual_char(Char *dst, size_t len, Char c)
*dst++ = tohexdigit(((unsigned int) c >> 4) & 0xf);
*dst = tohexdigit(((unsigned int) c ) & 0xf);
return (c > 0xffff) ? 8 : 7;
-#else
- *dst++ = '\\';
-#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);
-#endif
/*FALLTHROUGH*/
/* these two should be handled outside this function */
default: /* we should never hit the default */
diff --git a/lib/libedit/chartype.h b/lib/libedit/chartype.h
index 1f952c403a4..24ff1b382f3 100644
--- a/lib/libedit/chartype.h
+++ b/lib/libedit/chartype.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: chartype.h,v 1.13 2016/03/22 11:32:18 schwarze Exp $ */
+/* $OpenBSD: chartype.h,v 1.14 2016/04/09 19:31:55 schwarze Exp $ */
/* $NetBSD: chartype.h,v 1.5 2010/04/15 00:55:57 christos Exp $ */
/*-
@@ -31,8 +31,7 @@
#define _h_chartype_f
-
-#ifdef WIDECHAR
+#ifndef NARROWCHAR
/* Ideally we should also test the value of the define to see if it
* supports non-BMP code points without requiring UTF-16, but nothing
@@ -104,57 +103,25 @@
#else /* NARROW */
size_t ct_mbrtowc(wchar_t *, const char *, size_t, void *);
-#define ct_wctob(w) ((int)(w))
-#define ct_wctomb error
-#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 FUN(prefix,rest) prefix ## _ ## rest
#define FUNW(type) type
#define TYPE(type) type
-#define FSTR "%s"
-#define FSTARSTR "%.*s"
#define STR(x) x
-#define UC(c) (unsigned char)(c)
-
-#define Isalpha(x) isalpha((unsigned char)x)
-#define Isalnum(x) isalnum((unsigned char)x)
-#define Isgraph(x) isgraph((unsigned char)x)
-#define Isspace(x) isspace((unsigned char)x)
-#define Isdigit(x) isdigit((unsigned char)x)
-#define Iscntrl(x) iscntrl((unsigned char)x)
-#define Isprint(x) isprint((unsigned char)x)
-
-#define Isupper(x) isupper((unsigned char)x)
-#define Islower(x) islower((unsigned char)x)
-#define Toupper(x) toupper((unsigned char)x)
-#define Tolower(x) tolower((unsigned char)x)
-
-#define IsASCII(x) isascii((unsigned char)x)
#define Strlen(x) strlen(x)
#define Strchr(s,c) strchr(s,c)
-#define Strrchr(s,c) strrchr(s,c)
-#define Strstr(s,v) strstr(s,v)
#define Strdup(x) strdup(x)
-/* #define Strcpy(d,s) strcpy(d,s) */
#define Strncpy(d,s,n) strncpy(d,s,n)
#define Strncat(d,s,n) strncat(d,s,n)
#define Strcmp(s,v) strcmp(s,v)
#define Strncmp(s,v,n) strncmp(s,v,n)
-#define Strcspn(s,r) strcspn(s,r)
-
-#define Strtol(p,e,b) strtol(p,e,b)
-
-#define Width(c) 1
-
#endif
-#ifdef WIDECHAR
+#ifndef NARROWCHAR
/*
* Conversion buffer
*/
@@ -187,10 +154,6 @@ protected size_t ct_enc_width(Char);
#else
#define ct_encode_string(s, b) (s)
#define ct_decode_string(s, b) (s)
-#define ct_decode_argv(l, s, b) (s)
-#define ct_conv_buff_resize(b, os, ns)
-#define ct_encode_char(d, l, s) (*d = s, 1)
-#define ct_free_argv(s)
#endif
#ifndef NARROWCHAR
diff --git a/lib/libedit/el.c b/lib/libedit/el.c
index a377c5fe4be..aa201e1a0ea 100644
--- a/lib/libedit/el.c
+++ b/lib/libedit/el.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: el.c,v 1.29 2016/03/21 17:28:10 schwarze Exp $ */
+/* $OpenBSD: el.c,v 1.30 2016/04/09 19:31:55 schwarze Exp $ */
/* $NetBSD: el.c,v 1.61 2011/01/27 23:11:40 christos Exp $ */
/*-
@@ -40,14 +40,12 @@
*/
#include <sys/types.h>
#include <ctype.h>
+#include <langinfo.h>
#include <limits.h>
+#include <locale.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
-#ifdef WIDECHAR
-#include <locale.h>
-#include <langinfo.h>
-#endif
#include "el.h"
#include "parse.h"
@@ -131,12 +129,10 @@ el_end(EditLine *el)
sig_end(el);
free(el->el_prog);
-#ifdef WIDECHAR
free(el->el_scratch.cbuff);
free(el->el_scratch.wbuff);
free(el->el_lgcyconv.cbuff);
free(el->el_lgcyconv.wbuff);
-#endif
free(el);
}
diff --git a/lib/libedit/el.h b/lib/libedit/el.h
index e2258d7a1be..da30cd42ea9 100644
--- a/lib/libedit/el.h
+++ b/lib/libedit/el.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: el.h,v 1.17 2016/03/21 17:28:10 schwarze Exp $ */
-/* $NetBSD: el.h,v 1.34 2016/02/24 17:13:22 christos Exp $ */
+/* $OpenBSD: el.h,v 1.18 2016/04/09 19:31:55 schwarze Exp $ */
+/* $NetBSD: el.h,v 1.35 2016/03/23 22:27:48 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -127,11 +127,9 @@ struct editline {
el_search_t el_search; /* Search stuff */
el_signal_t el_signal; /* Signal handling stuff */
el_read_t el_read; /* Character reading stuff */
-#ifdef WIDECHAR
ct_buffer_t el_scratch; /* Scratch conversion buffer */
ct_buffer_t el_lgcyconv; /* Buffer for legacy wrappers */
LineInfo el_lgcylinfo; /* Legacy LineInfo buffer */
-#endif
};
protected int el_editmode(EditLine *, int, const Char **);
diff --git a/lib/libedit/eln.c b/lib/libedit/eln.c
index 4801b08c946..42334c6bd98 100644
--- a/lib/libedit/eln.c
+++ b/lib/libedit/eln.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eln.c,v 1.13 2016/03/22 11:21:02 martijn Exp $ */
+/* $OpenBSD: eln.c,v 1.14 2016/04/09 19:31:55 schwarze Exp $ */
/* $NetBSD: eln.c,v 1.9 2010/11/04 13:53:12 christos Exp $ */
/*-
@@ -56,7 +56,6 @@ el_getc(EditLine *el, char *cp)
}
-#ifdef WIDECHAR
public void
el_push(EditLine *el, const char *str)
{
@@ -376,4 +375,3 @@ el_insertstr(EditLine *el, const char *str)
{
return el_winsertstr(el, ct_decode_string(str, &el->el_lgcyconv));
}
-#endif /* WIDECHAR */
diff --git a/lib/libedit/hist.c b/lib/libedit/hist.c
index 209281c8e9a..3bf93534926 100644
--- a/lib/libedit/hist.c
+++ b/lib/libedit/hist.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: hist.c,v 1.13 2016/03/20 23:48:27 schwarze Exp $ */
-/* $NetBSD: hist.c,v 1.17 2009/12/30 23:54:52 christos Exp $ */
+/* $OpenBSD: hist.c,v 1.14 2016/04/09 19:31:55 schwarze Exp $ */
+/* $NetBSD: hist.c,v 1.25 2016/03/23 22:27:48 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -207,7 +207,6 @@ hist_enlargebuf(EditLine *el, size_t oldsz, size_t newsz)
return 1;
}
-#ifdef WIDECHAR
protected wchar_t *
hist_convert(EditLine *el, int fn, void *arg)
{
@@ -217,4 +216,3 @@ hist_convert(EditLine *el, int fn, void *arg)
return ct_decode_string((const char *)(const void *)ev.str,
&el->el_scratch);
}
-#endif
diff --git a/lib/libedit/hist.h b/lib/libedit/hist.h
index dc4eb0ae4c8..cb3a81c309b 100644
--- a/lib/libedit/hist.h
+++ b/lib/libedit/hist.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: hist.h,v 1.12 2016/03/20 23:48:27 schwarze Exp $ */
-/* $NetBSD: hist.h,v 1.18 2016/02/17 19:47:49 christos Exp $ */
+/* $OpenBSD: hist.h,v 1.13 2016/04/09 19:31:55 schwarze Exp $ */
+/* $NetBSD: hist.h,v 1.19 2016/03/23 22:27:48 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -56,14 +56,9 @@ typedef struct el_history_t {
#define HIST_FUN_INTERNAL(el, fn, arg) \
((((*(el)->el_history.fun) ((el)->el_history.ref, &(el)->el_history.ev, \
fn, arg)) == -1) ? NULL : (el)->el_history.ev.str)
-#ifdef WIDECHAR
#define HIST_FUN(el, fn, arg) \
(((el)->el_flags & NARROW_HISTORY) ? hist_convert(el, fn, arg) : \
HIST_FUN_INTERNAL(el, fn, arg))
-#else
-#define HIST_FUN(el, fn, arg) HIST_FUN_INTERNAL(el, fn, arg)
-#endif
-
#define HIST_NEXT(el) HIST_FUN(el, H_NEXT, NULL)
#define HIST_FIRST(el) HIST_FUN(el, H_FIRST, NULL)
@@ -80,8 +75,6 @@ protected el_action_t hist_get(EditLine *);
protected int hist_set(EditLine *, hist_fun_t, void *);
protected int hist_command(EditLine *, int, const Char **);
protected int hist_enlargebuf(EditLine *, size_t, size_t);
-#ifdef WIDECHAR
protected wchar_t *hist_convert(EditLine *, int, void *);
-#endif
#endif /* _h_el_hist */
diff --git a/lib/libedit/history.c b/lib/libedit/history.c
index ed318bf6179..dd5f0c9cc21 100644
--- a/lib/libedit/history.c
+++ b/lib/libedit/history.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: history.c,v 1.23 2016/03/20 23:48:27 schwarze Exp $ */
+/* $OpenBSD: history.c,v 1.24 2016/04/09 19:31:55 schwarze Exp $ */
/* $NetBSD: history.c,v 1.37 2010/01/03 18:27:10 christos Exp $ */
/*-
@@ -729,7 +729,7 @@ history_load(TYPE(History) *h, const char *fname)
char *ptr;
int i = -1;
TYPE(HistEvent) ev;
-#ifdef WIDECHAR
+#ifndef NARROWCHAR
static ct_buffer_t conv;
#endif
@@ -785,7 +785,7 @@ history_save_fp(TYPE(History) *h, FILE *fp)
int i = -1, retval;
size_t len, max_size;
char *ptr;
-#ifdef WIDECHAR
+#ifndef NARROWCHAR
static ct_buffer_t conv;
#endif
diff --git a/lib/libedit/keymacro.c b/lib/libedit/keymacro.c
index c44b5471601..a0a7806dc5f 100644
--- a/lib/libedit/keymacro.c
+++ b/lib/libedit/keymacro.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: keymacro.c,v 1.8 2016/03/21 15:25:39 schwarze Exp $ */
-/* $NetBSD: keymacro.c,v 1.14 2016/02/24 14:25:38 christos Exp $ */
+/* $OpenBSD: keymacro.c,v 1.9 2016/04/09 19:31:55 schwarze Exp $ */
+/* $NetBSD: keymacro.c,v 1.15 2016/03/23 22:27:48 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -212,10 +212,8 @@ keymacro_add(EditLine *el, const Char *key, keymacro_value_t *val, int ntype)
protected void
keymacro_clear(EditLine *el, el_action_t *map, const Char *in)
{
-#ifdef WIDECHAR
if (*in > N_KEYS) /* can't be in the map */
return;
-#endif
if ((map[(unsigned char)*in] == ED_SEQUENCE_LEAD_IN) &&
((map == el->el_map.key &&
el->el_map.alt[(unsigned char)*in] != ED_SEQUENCE_LEAD_IN) ||
diff --git a/lib/libedit/makelist b/lib/libedit/makelist
index 556e2d0cd38..df07cc25b12 100644
--- a/lib/libedit/makelist
+++ b/lib/libedit/makelist
@@ -55,7 +55,6 @@ case $FLAG in
#
-n)
cat << _EOF
-#undef WIDECHAR
#define NARROWCHAR
#include "${FILES}"
_EOF
diff --git a/lib/libedit/read.c b/lib/libedit/read.c
index 048f57f0098..12bdf8189f8 100644
--- a/lib/libedit/read.c
+++ b/lib/libedit/read.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: read.c,v 1.30 2016/04/05 21:24:02 krw Exp $ */
+/* $OpenBSD: read.c,v 1.31 2016/04/09 19:31:55 schwarze Exp $ */
/* $NetBSD: read.c,v 1.81 2016/02/16 22:53:14 christos Exp $ */
/*-
@@ -52,7 +52,6 @@
#define OKCMD -1 /* must be -1! */
private int read__fixio(int, int);
-private int read_preread(EditLine *);
private int read_char(EditLine *, wchar_t *);
private int read_getcmd(EditLine *, el_action_t *, Char *);
private void read_pop(c_macro_t *);
@@ -178,38 +177,6 @@ read__fixio(int fd __attribute__((__unused__)), int e)
}
-/* read_preread():
- * Try to read the stuff in the input queue;
- */
-private int
-read_preread(EditLine *el)
-{
- int chrs = 0;
-
- if (el->el_tty.t_mode == ED_IO)
- return 0;
-
-#ifndef WIDECHAR
-/* FIONREAD attempts to buffer up multiple bytes, and to make that work
- * properly with partial wide/UTF-8 characters would need some careful work. */
-#ifdef FIONREAD
- (void) ioctl(el->el_infd, FIONREAD, &chrs);
- if (chrs > 0) {
- char buf[EL_BUFSIZ];
-
- chrs = read(el->el_infd, buf,
- (size_t) MIN(chrs, EL_BUFSIZ - 1));
- if (chrs > 0) {
- buf[chrs] = '\0';
- el_push(el, buf);
- }
- }
-#endif /* FIONREAD */
-#endif
- return chrs > 0;
-}
-
-
/* el_push():
* Push a macro
*/
@@ -261,11 +228,9 @@ read_getcmd(EditLine *el, el_action_t *cmdnum, Char *ch)
el->el_state.metanext = 0;
*ch |= meta;
}
-#ifdef WIDECHAR
if (*ch >= N_KEYS)
cmd = ED_INSERT;
else
-#endif
cmd = el->el_map.current[(unsigned char) *ch];
if (cmd == ED_SEQUENCE_LEAD_IN) {
keymacro_value_t val;
@@ -404,11 +369,6 @@ el_wgetc(EditLine *el, wchar_t *cp)
terminal__flush(el);
for (;;) {
- if (ma->level < 0) {
- if (!read_preread(el))
- break;
- }
-
if (ma->level < 0)
break;
diff --git a/lib/libedit/readline.c b/lib/libedit/readline.c
index 5686053ed84..5bbaaf37056 100644
--- a/lib/libedit/readline.c
+++ b/lib/libedit/readline.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readline.c,v 1.19 2016/03/21 17:28:10 schwarze Exp $ */
+/* $OpenBSD: readline.c,v 1.20 2016/04/09 19:31:55 schwarze Exp $ */
/* $NetBSD: readline.c,v 1.91 2010/08/28 15:44:59 christos Exp $ */
/*-
@@ -1746,9 +1746,7 @@ _rl_completion_append_character_function(const char *dummy
int
rl_complete(int ignore __attribute__((__unused__)), int invoking_key)
{
-#ifdef WIDECHAR
static ct_buffer_t wbreak_conv, sprefix_conv;
-#endif
if (h == NULL || e == NULL)
rl_initialize();
diff --git a/lib/libedit/search.c b/lib/libedit/search.c
index cd431bbd8ab..15ab6acbadd 100644
--- a/lib/libedit/search.c
+++ b/lib/libedit/search.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: search.c,v 1.20 2016/03/21 15:25:39 schwarze Exp $ */
-/* $NetBSD: search.c,v 1.39 2016/02/24 14:25:38 christos Exp $ */
+/* $OpenBSD: search.c,v 1.21 2016/04/09 19:31:55 schwarze Exp $ */
+/* $NetBSD: search.c,v 1.40 2016/03/23 22:27:48 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -106,9 +106,7 @@ regerror(const char *msg)
protected int
el_match(const Char *str, const Char *pat)
{
-#ifdef WIDECHAR
static ct_buffer_t conv;
-#endif
#if defined (REGEX)
regex_t re;
int rv;
diff --git a/lib/libedit/sys.h b/lib/libedit/sys.h
index 129547f86b7..82f0b7acee0 100644
--- a/lib/libedit/sys.h
+++ b/lib/libedit/sys.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys.h,v 1.15 2016/03/20 23:48:27 schwarze Exp $ */
+/* $OpenBSD: sys.h,v 1.16 2016/04/09 19:31:55 schwarze Exp $ */
/* $NetBSD: sys.h,v 1.13 2009/12/30 22:37:40 christos Exp $ */
/*-
@@ -96,11 +96,6 @@ ssize_t getline(char **line, size_t *len, FILE *fp);
#define REGEX /* Use POSIX.2 regular expression functions */
#undef REGEXP /* Use UNIX V8 regular expression functions */
-#ifndef WIDECHAR
-#define setlocale(c, l) /*LINTED*/NULL
-#define nl_langinfo(i) ""
-#endif
-
#if defined(__sun)
extern int tgetent(char *, const char *);
extern int tgetflag(char *);
diff --git a/lib/libedit/terminal.c b/lib/libedit/terminal.c
index 0271c2243f4..f65710f9fb0 100644
--- a/lib/libedit/terminal.c
+++ b/lib/libedit/terminal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: terminal.c,v 1.11 2016/03/22 11:32:18 schwarze Exp $ */
+/* $OpenBSD: terminal.c,v 1.12 2016/04/09 19:31:55 schwarze Exp $ */
/* $NetBSD: terminal.c,v 1.17 2016/02/15 15:35:03 christos Exp $ */
/*-
@@ -501,13 +501,11 @@ terminal_move_to_line(EditLine *el, int where)
if (EL_HAS_AUTO_MARGINS &&
el->el_display[el->el_cursor.v][0] != '\0') {
size_t h = el->el_terminal.t_size.h - 1;
-#ifdef WIDECHAR
for (; h > 0 &&
el->el_display[el->el_cursor.v][h] ==
MB_FILL_CHAR;
h--)
continue;
-#endif
/* move without newline */
terminal_move_to_char(el, (int)h);
terminal_overwrite(el, &el->el_display
@@ -582,11 +580,9 @@ mc_again:
if (EL_CAN_TAB) {
if ((el->el_cursor.h & 0370) !=
(where & ~0x7)
-#ifdef WIDECHAR
&& (el->el_display[
el->el_cursor.v][where & 0370] !=
MB_FILL_CHAR)
-#endif
) {
/* if not within tab stop */
for (i =
@@ -674,11 +670,9 @@ terminal_overwrite(EditLine *el, const Char *cp, size_t n)
if ((c = el->el_display[el->el_cursor.v]
[el->el_cursor.h]) != '\0') {
terminal_overwrite(el, &c, 1);
-#ifdef WIDECHAR
while (el->el_display[el->el_cursor.v]
[el->el_cursor.h] == MB_FILL_CHAR)
el->el_cursor.h++;
-#endif
} else {
terminal__putc(el, ' ');
el->el_cursor.h = 1;