Hello community, here is the log from the commit of package libedit for openSUSE:Factory checked in at 2015-03-03 11:10:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libedit (Old) and /work/SRC/openSUSE:Factory/.libedit.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libedit" Changes: -------- --- /work/SRC/openSUSE:Factory/libedit/libedit.changes 2014-07-30 07:34:53.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libedit.new/libedit.changes 2015-03-03 11:10:13.000000000 +0100 @@ -1,0 +2,8 @@ +Thu Feb 26 18:40:47 UTC 2015 - mplus...@suse.com + +- Update to 20141030-3.1 + * version-info: 0:52:0 + * all: sync with upstream source + * configura.ac: Fix posix shell portability issue. + +------------------------------------------------------------------- Old: ---- libedit-20140620-3.1.tar.gz New: ---- libedit-20141030-3.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libedit.spec ++++++ --- /var/tmp/diff_new_pack.2dCcX7/_old 2015-03-03 11:10:14.000000000 +0100 +++ /var/tmp/diff_new_pack.2dCcX7/_new 2015-03-03 11:10:14.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package libedit # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,10 +17,10 @@ Name: libedit -Version: 3.1.snap20140620 +Version: 3.1.snap20141030 Release: 0 %define pkg_name libedit -%define pkg_version 20140620-3.1 +%define pkg_version 20141030-3.1 # # BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -74,7 +74,7 @@ This package holds the development files for libedit. %prep -%setup -q -n %{pkg_name}-%{pkg_version} +%setup -q -n %{pkg_name}-20141029-3.1 %{__cp} %{S:1} . %patch2 %patch3 ++++++ libedit-20140620-3.1.tar.gz -> libedit-20141030-3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/ChangeLog new/libedit-20141029-3.1/ChangeLog --- old/libedit-20140620-3.1/ChangeLog 2014-06-20 20:58:33.000000000 +0200 +++ new/libedit-20141029-3.1/ChangeLog 2014-10-29 23:52:54.000000000 +0100 @@ -1,6 +1,14 @@ * See also NetBSD changelog: http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit +2014-10-30 Jess Thrysoee + + * version-info: 0:52:0 + + * all: sync with upstream source + + * configura.ac: Fix posix shell portability issue. Patch by Ryo Onodera. + 2014-06-20 Jess Thrysoee * version-info: 0:51:0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/configure new/libedit-20141029-3.1/configure --- old/libedit-20140620-3.1/configure 2014-06-20 20:59:27.000000000 +0200 +++ new/libedit-20141029-3.1/configure 2014-10-29 23:53:21.000000000 +0100 @@ -586,7 +586,7 @@ # Identity of this package. PACKAGE_NAME='libedit' -PACKAGE_TARNAME='libedit-20140620' +PACKAGE_TARNAME='libedit-20141029' PACKAGE_VERSION='3.1' PACKAGE_STRING='libedit 3.1' PACKAGE_BUGREPORT='' @@ -1373,7 +1373,7 @@ --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root - [DATAROOTDIR/doc/libedit-20140620] + [DATAROOTDIR/doc/libedit-20141029] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] @@ -4217,7 +4217,7 @@ # Define the identity of the package. - PACKAGE='libedit-20140620' + PACKAGE='libedit-20141029' VERSION='3.1' @@ -11624,7 +11624,7 @@ # libtool -version-info -LT_VERSION=0:51:0 +LT_VERSION=0:52:0 # Check whether --enable-silent-rules was given. @@ -12277,7 +12277,7 @@ fi - if test "$enable_examples" == "yes"; then + if test "$enable_examples" = "yes"; then ENABLE_EXAMPLES_TRUE= ENABLE_EXAMPLES_FALSE='#' else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/configure.ac new/libedit-20141029-3.1/configure.ac --- old/libedit-20140620-3.1/configure.ac 2014-06-20 20:58:36.000000000 +0200 +++ new/libedit-20141029-3.1/configure.ac 2014-10-29 23:52:57.000000000 +0100 @@ -35,7 +35,7 @@ AC_PROG_LIBTOOL # libtool -version-info -AC_SUBST(LT_VERSION, [0:51:0]) +AC_SUBST(LT_VERSION, [0:52:0]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -72,7 +72,7 @@ [enable_examples="yes"] ) -AM_CONDITIONAL(ENABLE_EXAMPLES, [test "$enable_examples" == "yes"]) +AM_CONDITIONAL(ENABLE_EXAMPLES, [test "$enable_examples" = "yes"]) # Checks for header files. AC_HEADER_DIRENT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/doc/Makefile.in new/libedit-20141029-3.1/doc/Makefile.in --- old/libedit-20140620-3.1/doc/Makefile.in 2014-06-20 20:59:28.000000000 +0200 +++ new/libedit-20141029-3.1/doc/Makefile.in 2014-10-29 23:53:23.000000000 +0100 @@ -281,9 +281,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign doc/Makefile + $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/examples/Makefile.in new/libedit-20141029-3.1/examples/Makefile.in --- old/libedit-20140620-3.1/examples/Makefile.in 2014-06-20 20:59:28.000000000 +0200 +++ new/libedit-20141029-3.1/examples/Makefile.in 2014-10-29 23:53:23.000000000 +0100 @@ -310,9 +310,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign examples/Makefile + $(AUTOMAKE) --gnu examples/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/examples/tc1.c new/libedit-20141029-3.1/examples/tc1.c --- old/libedit-20140620-3.1/examples/tc1.c 2013-07-12 20:42:50.000000000 +0200 +++ new/libedit-20141029-3.1/examples/tc1.c 2014-10-29 23:49:45.000000000 +0100 @@ -1,4 +1,4 @@ -/* $NetBSD: tc1.c,v 1.5 2010/04/18 21:17:47 christos Exp $ */ +/* $NetBSD: tc1.c,v 1.6 2014/06/18 20:12:15 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)test.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: tc1.c,v 1.5 2010/04/18 21:17:47 christos Exp $"); +__RCSID("$NetBSD: tc1.c,v 1.6 2014/06/18 20:12:15 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -194,7 +194,7 @@ #endif if (gotsig) { - (void) fprintf(stderr, "Got signal %d.\n", gotsig); + (void) fprintf(stderr, "Got signal %d.\n", (int)gotsig); gotsig = 0; el_reset(el); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/examples/wtc1.c new/libedit-20141029-3.1/examples/wtc1.c --- old/libedit-20140620-3.1/examples/wtc1.c 2012-03-11 10:54:58.000000000 +0100 +++ new/libedit-20141029-3.1/examples/wtc1.c 2014-10-29 23:49:45.000000000 +0100 @@ -170,7 +170,7 @@ #endif if (gotsig) { - (void)fprintf(stderr, "Got signal %d.\n", gotsig); + (void)fprintf(stderr, "Got signal %d.\n", (int)gotsig); gotsig = 0; el_reset(el); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/src/Makefile.in new/libedit-20141029-3.1/src/Makefile.in --- old/libedit-20140620-3.1/src/Makefile.in 2014-06-20 20:59:28.000000000 +0200 +++ new/libedit-20141029-3.1/src/Makefile.in 2014-10-29 23:53:23.000000000 +0100 @@ -372,9 +372,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/Makefile + $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/src/filecomplete.c new/libedit-20141029-3.1/src/filecomplete.c --- old/libedit-20140620-3.1/src/filecomplete.c 2014-06-18 18:05:56.000000000 +0200 +++ new/libedit-20141029-3.1/src/filecomplete.c 2014-10-29 23:49:45.000000000 +0100 @@ -1,4 +1,4 @@ -/* $NetBSD: filecomplete.c,v 1.32 2014/06/05 22:07:42 christos Exp $ */ +/* $NetBSD: filecomplete.c,v 1.34 2014/10/18 15:07:02 riz Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: filecomplete.c,v 1.32 2014/06/05 22:07:42 christos Exp $"); +__RCSID("$NetBSD: filecomplete.c,v 1.34 2014/10/18 15:07:02 riz Exp $"); #endif /* not lint && not SCCSID */ #include <sys/types.h> @@ -66,7 +66,7 @@ * if ``user'' isn't valid user name or ``txt'' doesn't start * w/ '~', returns pointer to strdup()ed copy of ``txt'' * - * it's callers's responsibility to free() returned string + * it's the caller's responsibility to free() the returned string */ char * fn_tilde_expand(const char *txt) @@ -139,7 +139,7 @@ * such file can be found * value of ``state'' is ignored * - * it's caller's responsibility to free returned string + * it's the caller's responsibility to free the returned string */ char * fn_filename_completion_function(const char *text, int state) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/src/map.c new/libedit-20141029-3.1/src/map.c --- old/libedit-20140620-3.1/src/map.c 2013-06-01 17:46:07.000000000 +0200 +++ new/libedit-20141029-3.1/src/map.c 2014-10-29 23:49:45.000000000 +0100 @@ -1,4 +1,4 @@ -/* $NetBSD: map.c,v 1.33 2013/01/01 15:34:02 christos Exp $ */ +/* $NetBSD: map.c,v 1.34 2014/07/06 18:15:34 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: map.c,v 1.33 2013/01/01 15:34:02 christos Exp $"); +__RCSID("$NetBSD: map.c,v 1.34 2014/07/06 18:15:34 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -1396,7 +1396,7 @@ map_addfunc(EditLine *el, const Char *name, const Char *help, el_func_t func) { void *p; - size_t nf = (size_t)el->el_map.nfunc + 1; + size_t nf = el->el_map.nfunc + 1; if (name == NULL || help == NULL || func == NULL) return -1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/src/map.h new/libedit-20141029-3.1/src/map.h --- old/libedit-20140620-3.1/src/map.h 2010-04-22 21:13:17.000000000 +0200 +++ new/libedit-20141029-3.1/src/map.h 2014-10-29 23:49:45.000000000 +0100 @@ -1,4 +1,4 @@ -/* $NetBSD: map.h,v 1.9 2009/12/30 22:37:40 christos Exp $ */ +/* $NetBSD: map.h,v 1.10 2014/07/06 18:15:34 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -57,7 +57,7 @@ int type; /* Emacs or vi */ el_bindings_t *help; /* The help for the editor functions */ el_func_t *func; /* List of available functions */ - int nfunc; /* The number of functions/help items */ + size_t nfunc; /* The number of functions/help items */ } el_map_t; #define MAP_EMACS 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/src/parse.c new/libedit-20141029-3.1/src/parse.c --- old/libedit-20140620-3.1/src/parse.c 2012-03-11 10:54:58.000000000 +0100 +++ new/libedit-20141029-3.1/src/parse.c 2014-10-29 23:49:45.000000000 +0100 @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.26 2011/08/16 16:25:15 christos Exp $ */ +/* $NetBSD: parse.c,v 1.27 2014/07/06 18:15:34 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: parse.c,v 1.26 2011/08/16 16:25:15 christos Exp $"); +__RCSID("$NetBSD: parse.c,v 1.27 2014/07/06 18:15:34 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -276,10 +276,11 @@ protected int parse_cmd(EditLine *el, const Char *cmd) { - el_bindings_t *b; + el_bindings_t *b = el->el_map.help; + size_t i; - for (b = el->el_map.help; b->name != NULL; b++) - if (Strcmp(b->name, cmd) == 0) - return b->func; + for (i = 0; i < el->el_map.nfunc; i++) + if (Strcmp(b[i].name, cmd) == 0) + return b[i].func; return -1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/src/read.c new/libedit-20141029-3.1/src/read.c --- old/libedit-20140620-3.1/src/read.c 2013-06-01 17:46:07.000000000 +0200 +++ new/libedit-20141029-3.1/src/read.c 2014-10-29 23:49:45.000000000 +0100 @@ -1,4 +1,4 @@ -/* $NetBSD: read.c,v 1.70 2013/05/27 23:55:55 christos Exp $ */ +/* $NetBSD: read.c,v 1.71 2014/07/06 18:15:34 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: read.c,v 1.70 2013/05/27 23:55:55 christos Exp $"); +__RCSID("$NetBSD: read.c,v 1.71 2014/07/06 18:15:34 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -597,7 +597,7 @@ el->el_line.cursor = el->el_line.buffer; break; } - if ((unsigned int)cmdnum >= (unsigned int)el->el_map.nfunc) { /* BUG CHECK command */ + if ((size_t)cmdnum >= el->el_map.nfunc) { /* BUG CHECK command */ #ifdef DEBUG_EDIT (void) fprintf(el->el_errfile, "ERROR: illegal command from key 0%o\r\n", ch); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/src/readline.c new/libedit-20141029-3.1/src/readline.c --- old/libedit-20140620-3.1/src/readline.c 2014-02-13 23:01:35.000000000 +0100 +++ new/libedit-20141029-3.1/src/readline.c 2014-10-29 23:49:45.000000000 +0100 @@ -1,4 +1,4 @@ -/* $NetBSD: readline.c,v 1.110 2014/01/21 13:51:44 christos Exp $ */ +/* $NetBSD: readline.c,v 1.113 2014/10/18 08:33:23 snj 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.110 2014/01/21 13:51:44 christos Exp $"); +__RCSID("$NetBSD: readline.c,v 1.113 2014/10/18 08:33:23 snj Exp $"); #endif /* not lint && not SCCSID */ #include <sys/types.h> @@ -342,7 +342,7 @@ el_set(e, EL_SIGNAL, rl_catch_signals); /* set default mode to "emacs"-style and read setting afterwards */ - /* so this can be overriden */ + /* so this can be overridden */ el_set(e, EL_EDITOR, "emacs"); if (rl_terminal_name != NULL) el_set(e, EL_TERMINAL, rl_terminal_name); @@ -638,7 +638,7 @@ * returns 0 if data was not modified, 1 if it was and 2 if the string * should be only printed and not executed; in case of error, * returns -1 and *result points to NULL - * it's callers responsibility to free() string returned in *result + * it's the caller's responsibility to free() the string returned in *result */ static int _history_expand_command(const char *command, size_t offs, size_t cmdlen, @@ -1698,7 +1698,7 @@ * which starts with supplied text * text contains a partial username preceded by random character * (usually '~'); state resets search from start (??? should we do that anyway) - * it's callers responsibility to free returned value + * it's the caller's responsibility to free the returned value */ char * username_completion_function(const char *text, int state) @@ -1966,7 +1966,7 @@ } else wbuf = NULL; (*(void (*)(const char *))rl_linefunc)(wbuf); - //el_set(e, EL_UNBUFFERED, 1); + el_set(e, EL_UNBUFFERED, 1); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/src/unvis.c new/libedit-20141029-3.1/src/unvis.c --- old/libedit-20140620-3.1/src/unvis.c 2013-06-01 17:46:07.000000000 +0200 +++ new/libedit-20141029-3.1/src/unvis.c 2014-10-29 23:49:45.000000000 +0100 @@ -1,4 +1,4 @@ -/* $NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $ */ +/* $NetBSD: unvis.c,v 1.44 2014/09/26 15:43:36 roy Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $"); +__RCSID("$NetBSD: unvis.c,v 1.44 2014/09/26 15:43:36 roy Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -314,6 +314,12 @@ */ *astate = SS(0, S_GROUND); return UNVIS_NOCHAR; + default: + if (isgraph(c)) { + *cp = c; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + } } goto bad; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/src/vis.c new/libedit-20141029-3.1/src/vis.c --- old/libedit-20140620-3.1/src/vis.c 2013-06-01 18:09:32.000000000 +0200 +++ new/libedit-20141029-3.1/src/vis.c 2014-10-29 23:49:45.000000000 +0100 @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.60 2013/02/21 16:21:20 joerg Exp $ */ +/* $NetBSD: vis.c,v 1.66 2014/09/26 15:58:59 roy Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -58,7 +58,7 @@ #include "config.h" #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.60 2013/02/21 16:21:20 joerg Exp $"); +__RCSID("$NetBSD: vis.c,v 1.66 2014/09/26 15:58:59 roy Exp $"); #endif /* LIBC_SCCS and not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); @@ -104,7 +104,10 @@ #define xtoa(c) L"0123456789abcdef"[c] #define XTOA(c) L"0123456789ABCDEF"[c] -#define MAXEXTRAS 10 +#define MAXEXTRAS 30 + +static const wchar_t char_shell[] = L"'`\";&<>()|{}]\\$!^~"; +static const wchar_t char_glob[] = L"*?[#"; #if !HAVE_NBTOOL_CONFIG_H #ifndef __NetBSD__ @@ -215,8 +218,23 @@ *dst++ = L'0'; } return dst; + /* We cannot encode these characters in VIS_CSTYLE + * because they special meaning */ + case L'n': + case L'r': + case L'b': + case L'a': + case L'v': + case L't': + case L'f': + case L's': + case L'0': + case L'M': + case L'^': + case L'$': /* vis(1) -l */ + break; default: - if (iswgraph(c)) { + if (iswgraph(c) && !iswoctal(c)) { *dst++ = L'\\'; *dst++ = c; return dst; @@ -312,6 +330,7 @@ { wchar_t *dst, *d; size_t len; + const wchar_t *s; len = strlen(src); if ((dst = calloc(len + MAXEXTRAS, sizeof(*dst))) == NULL) @@ -320,17 +339,18 @@ if (mbstowcs(dst, src, len) == (size_t)-1) { size_t i; for (i = 0; i < len; i++) - dst[i] = (wint_t)(u_char)src[i]; + dst[i] = (wchar_t)(u_char)src[i]; d = dst + len; } else d = dst + wcslen(dst); - if (flags & VIS_GLOB) { - *d++ = L'*'; - *d++ = L'?'; - *d++ = L'['; - *d++ = L'#'; - } + if (flags & VIS_GLOB) + for (s = char_glob; *s; *d++ = *s++) + continue; + + if (flags & VIS_SHELL) + for (s = char_shell; *s; *d++ = *s++) + continue; if (flags & VIS_SP) *d++ = L' '; if (flags & VIS_TAB) *d++ = L'\t'; @@ -359,7 +379,7 @@ ssize_t mbslength, maxolen; _DIAGASSERT(mbdst != NULL); - _DIAGASSERT(mbsrc != NULL); + _DIAGASSERT(mbsrc != NULL || mblength == 0); _DIAGASSERT(mbextra != NULL); /* @@ -377,8 +397,6 @@ /* Allocate space for the wide char strings */ psrc = pdst = extra = NULL; - if (!mblength) - mblength = strlen(mbsrc); if ((psrc = calloc(mblength + 1, sizeof(*psrc))) == NULL) return -1; if ((pdst = calloc((4 * mblength) + 1, sizeof(*pdst))) == NULL) @@ -530,6 +548,15 @@ free(psrc); return error; } + +static int +istrsenvisxl(char *mbdst, size_t *dlen, const char *mbsrc, + int flags, const char *mbextra, int *cerr_ptr) +{ + return istrsenvisx(mbdst, dlen, mbsrc, + mbsrc != NULL ? strlen(mbsrc) : 0, flags, mbextra, cerr_ptr); +} + #endif #if !HAVE_SVIS @@ -573,13 +600,13 @@ int strsvis(char *mbdst, const char *mbsrc, int flags, const char *mbextra) { - return istrsenvisx(mbdst, NULL, mbsrc, 0, flags, mbextra, NULL); + return istrsenvisxl(mbdst, NULL, mbsrc, flags, mbextra, NULL); } int strsnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags, const char *mbextra) { - return istrsenvisx(mbdst, &dlen, mbsrc, 0, flags, mbextra, NULL); + return istrsenvisxl(mbdst, &dlen, mbsrc, flags, mbextra, NULL); } int @@ -648,13 +675,13 @@ int strvis(char *mbdst, const char *mbsrc, int flags) { - return istrsenvisx(mbdst, NULL, mbsrc, 0, flags, "", NULL); + return istrsenvisxl(mbdst, NULL, mbsrc, flags, "", NULL); } int strnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags) { - return istrsenvisx(mbdst, &dlen, mbsrc, 0, flags, "", NULL); + return istrsenvisxl(mbdst, &dlen, mbsrc, flags, "", NULL); } /* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libedit-20140620-3.1/src/vis.h new/libedit-20141029-3.1/src/vis.h --- old/libedit-20140620-3.1/src/vis.h 2013-06-01 17:46:07.000000000 +0200 +++ new/libedit-20141029-3.1/src/vis.h 2014-10-29 23:49:45.000000000 +0100 @@ -1,4 +1,4 @@ -/* $NetBSD: vis.h,v 1.21 2013/02/20 17:01:15 christos Exp $ */ +/* $NetBSD: vis.h,v 1.22 2014/09/26 01:21:07 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -61,6 +61,8 @@ #define VIS_NOESCAPE 0x0400 /* don't decode `\' */ #define _VIS_END 0x0800 /* for unvis */ #define VIS_GLOB 0x1000 /* encode glob(3) magic characters */ +#define VIS_SHELL 0x2000 /* encode shell special characters [not glob] */ +#define VIS_META (VIS_WHITE | VIS_GLOB | VIS_SHELL) /* * unvis return codes -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org