From 839bac947e652c79141a6ebac723e52784020894 Mon Sep 17 00:00:00 2001 From: christos Date: Thu, 15 Apr 2010 00:57:33 +0000 Subject: [PATCH] From Jess Thrysoee - Fix wint_t to Int confusion --- lib/libedit/chared.h | 18 +++++++++--------- lib/libedit/makelist | 6 +++--- lib/libedit/readline.c | 9 ++++++--- lib/libedit/search.c | 8 ++++---- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/lib/libedit/chared.h b/lib/libedit/chared.h index f938a58c6b4c..cbe4e5834117 100644 --- a/lib/libedit/chared.h +++ b/lib/libedit/chared.h @@ -1,4 +1,4 @@ -/* $NetBSD: chared.h,v 1.19 2009/12/30 22:37:40 christos Exp $ */ +/* $NetBSD: chared.h,v 1.20 2010/04/15 00:57:33 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -139,17 +139,17 @@ typedef struct el_chared_t { #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 *); diff --git a/lib/libedit/makelist b/lib/libedit/makelist index 3fe669581b3e..c8a2f6861e4d 100644 --- a/lib/libedit/makelist +++ b/lib/libedit/makelist @@ -1,5 +1,5 @@ #!/bin/sh - -# $NetBSD: makelist,v 1.14 2009/12/30 23:54:52 christos Exp $ +# $NetBSD: makelist,v 1.15 2010/04/15 00:57:33 christos Exp $ # # Copyright (c) 1992, 1993 # The Regents of the University of California. All rights reserved. @@ -77,7 +77,7 @@ _EOF # XXX: need a space between name and prototype so that -fc and -fh # parsing is much easier # - printf("protected el_action_t\t%s (EditLine *, wint_t);\n", name); + printf("protected el_action_t\t%s (EditLine *, Int);\n", name); } } END { @@ -161,7 +161,7 @@ _EOF END { printf("#define\t%-30.30s\t%3d\n", "EL_NUM_FCNS", count); - printf("typedef el_action_t (*el_func_t)(EditLine *, wint_t);"); + printf("typedef el_action_t (*el_func_t)(EditLine *, Int);"); printf("\nprotected const el_func_t* func__get(void);\n"); printf("#endif /* _h_fcns_c */\n"); }' diff --git a/lib/libedit/readline.c b/lib/libedit/readline.c index a8cd8d0649b1..a0a390cc61f1 100644 --- a/lib/libedit/readline.c +++ b/lib/libedit/readline.c @@ -1,4 +1,4 @@ -/* $NetBSD: readline.c,v 1.88 2010/01/03 18:27:10 christos Exp $ */ +/* $NetBSD: readline.c,v 1.89 2010/04/15 00:57:33 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: readline.c,v 1.88 2010/01/03 18:27:10 christos Exp $"); +__RCSID("$NetBSD: readline.c,v 1.89 2010/04/15 00:57:33 christos Exp $"); #endif /* not lint && not SCCSID */ #include @@ -1364,11 +1364,14 @@ int add_history(const char *line) { TYPE(HistEvent) ev; + const Char *wline; if (h == NULL || e == NULL) rl_initialize(); - (void)FUNW(history)(h, &ev, H_ENTER, line); + wline = ct_decode_string(line, &conv); + + (void)FUNW(history)(h, &ev, H_ENTER, wline); if (FUNW(history)(h, &ev, H_GETSIZE) == 0) history_length = ev.num; diff --git a/lib/libedit/search.c b/lib/libedit/search.c index e97fd6135277..366d3c4342a2 100644 --- a/lib/libedit/search.c +++ b/lib/libedit/search.c @@ -1,4 +1,4 @@ -/* $NetBSD: search.c,v 1.23 2009/12/30 23:54:52 christos Exp $ */ +/* $NetBSD: search.c,v 1.24 2010/04/15 00:57:33 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)search.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: search.c,v 1.23 2009/12/30 23:54:52 christos Exp $"); +__RCSID("$NetBSD: search.c,v 1.24 2010/04/15 00:57:33 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -564,7 +564,7 @@ ce_search_line(EditLine *el, int dir) * Vi repeat search */ protected el_action_t -cv_repeat_srch(EditLine *el, wint_t c) +cv_repeat_srch(EditLine *el, Int c) { #ifdef SDEBUG @@ -590,7 +590,7 @@ cv_repeat_srch(EditLine *el, wint_t c) * Vi character search */ protected el_action_t -cv_csearch(EditLine *el, int direction, wint_t ch, int count, int tflag) +cv_csearch(EditLine *el, int direction, Int ch, int count, int tflag) { Char *cp;