r57364 - in /branches/upstream/libterm-readline-gnu-perl/current: Gnu.pm Gnu.xs META.yml Makefile.PL README t/readline.t
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Mon May 3 12:56:26 UTC 2010
Author: jawnsy-guest
Date: Mon May 3 12:56:11 2010
New Revision: 57364
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=57364
Log:
[svn-upgrade] Integrating new upstream version, libterm-readline-gnu-perl (1.20)
Modified:
branches/upstream/libterm-readline-gnu-perl/current/Gnu.pm
branches/upstream/libterm-readline-gnu-perl/current/Gnu.xs
branches/upstream/libterm-readline-gnu-perl/current/META.yml
branches/upstream/libterm-readline-gnu-perl/current/Makefile.PL
branches/upstream/libterm-readline-gnu-perl/current/README
branches/upstream/libterm-readline-gnu-perl/current/t/readline.t
Modified: branches/upstream/libterm-readline-gnu-perl/current/Gnu.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-readline-gnu-perl/current/Gnu.pm?rev=57364&op=diff
==============================================================================
--- branches/upstream/libterm-readline-gnu-perl/current/Gnu.pm (original)
+++ branches/upstream/libterm-readline-gnu-perl/current/Gnu.pm Mon May 3 12:56:11 2010
@@ -1,7 +1,7 @@
#
# Gnu.pm --- The GNU Readline/History Library wrapper module
#
-# $Id: Gnu.pm,v 1.100 2009/03/20 16:33:25 hiroo Exp $
+# $Id: Gnu.pm,v 1.101 2010/05/02 10:39:19 hiroo Exp $
#
# Copyright (c) 2009 Hiroo Hayashi. All rights reserved.
#
@@ -73,7 +73,7 @@
use DynaLoader;
use vars qw($VERSION @ISA @EXPORT_OK);
- $VERSION = '1.19';
+ $VERSION = '1.20';
# Term::ReadLine::Gnu::AU makes a function in
# `Term::ReadLine::Gnu::XS' as a method.
@@ -776,6 +776,10 @@
Keymap rl_discard_keymap(Keymap|str map)
+=item C<free_keymap(MAP)>
+
+ void rl_free_keymap(Keymap|str map)
+
=item C<get_keymap>
Keymap rl_get_keymap()
Modified: branches/upstream/libterm-readline-gnu-perl/current/Gnu.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-readline-gnu-perl/current/Gnu.xs?rev=57364&op=diff
==============================================================================
--- branches/upstream/libterm-readline-gnu-perl/current/Gnu.xs (original)
+++ branches/upstream/libterm-readline-gnu-perl/current/Gnu.xs Mon May 3 12:56:11 2010
@@ -1,9 +1,9 @@
/*
* Gnu.xs --- GNU Readline wrapper module
*
- * $Id: Gnu.xs,v 1.112 2009/02/27 12:44:41 hiroo Exp $
+ * $Id: Gnu.xs,v 1.114 2010/05/02 10:34:41 hiroo Exp $
*
- * Copyright (c) 2009 Hiroo Hayashi. All rights reserved.
+ * Copyright (c) 2010 Hiroo Hayashi. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the same terms as Perl itself.
@@ -232,6 +232,20 @@
*/
static void rl_echo_signal_char(int sig){}
#endif /* (RL_VERSION_MAJOR < 6) */
+
+#if 0 /* comment out until GNU Readline 6.2 will be released. */
+#if (RL_READLINE_VERSION < 0x0601)
+/* features introduced by GNU Readline 6.1 */
+/* Convenience function that discards, then frees, MAP. */
+void
+rl_free_keymap (map)
+ Keymap map;
+{
+ rl_discard_keymap (map);
+ free ((char *)map);
+}
+#endif /* (RL_READLINE_VERSION < 0x0601) */
+#endif
/*
* utility/dummy functions
@@ -1411,6 +1425,12 @@
OUTPUT:
RETVAL
+ # comment out until GNU Readline 6.2 will be released.
+ #void
+ #rl_free_keymap(map)
+ # Keymap map
+ # PROTOTYPE: $
+
Keymap
rl_get_keymap()
PROTOTYPE:
@@ -1943,6 +1963,56 @@
int
rl_initialize()
PROTOTYPE:
+ CODE:
+ {
+ RETVAL = rl_initialize();
+ /*
+ * Perl optionally maintains its own envirnment variable array
+ * using its own memory management functions. On the other hand
+ * the GNU Readline Library sets variables, $LINES and $COLUMNS,
+ * by using the C library function putenv() in
+ * rl_initialize(). When Perl frees the memory for the variables
+ * during the destruction (perl.c:perl_destruct()), it may cause
+ * segmentation faults.
+ *
+ * CPAN ticket #37194
+ * https://rt.cpan.org/Public/Bug/Display.html?id=37194
+ *
+ * To solve the problem, make a copy of the whole environment
+ * variable array which might be reallocated by rl_initialize().
+ */
+ /* from perl.c:perl_destruct() */
+#if defined(USE_ENVIRON_ARRAY) && !defined(PERL_USE_SAFE_PUTENV) \
+ && !defined(PERL_DARWIN)
+ if (environ != PL_origenviron && !PL_use_safe_putenv
+# ifdef USE_ITHREADS
+ /* only main thread can free environ[0] contents */
+ && PL_curinterp == aTHX
+# endif
+ ) {
+ int i, len;
+ char *s;
+ char **tmpenv;
+ for (i = 0; environ[i]; i++)
+ ;
+ /*
+ * We cannot use New*() which uses safemalloc() instead of
+ * safesysmalloc().
+ */
+ tmpenv = (char **)safesysmalloc((i+1)*sizeof(char *));
+ for (i = 0; environ[i]; i++) {
+ len = strlen(environ[i]);
+ s = (char*)safesysmalloc((len+1)*sizeof(char));
+ Copy(environ[i], s, len+1, char);
+ tmpenv[i] = s;
+ }
+ tmpenv[i] = NULL;
+ environ = tmpenv;
+ }
+#endif
+ }
+ OUTPUT:
+ RETVAL
int
rl_ding()
Modified: branches/upstream/libterm-readline-gnu-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-readline-gnu-perl/current/META.yml?rev=57364&op=diff
==============================================================================
--- branches/upstream/libterm-readline-gnu-perl/current/META.yml (original)
+++ branches/upstream/libterm-readline-gnu-perl/current/META.yml Mon May 3 12:56:11 2010
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Term-ReadLine-Gnu
-version: 1.19
+version: 1.20
version_from: Gnu.pm
installdirs: site
requires:
Modified: branches/upstream/libterm-readline-gnu-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-readline-gnu-perl/current/Makefile.PL?rev=57364&op=diff
==============================================================================
--- branches/upstream/libterm-readline-gnu-perl/current/Makefile.PL (original)
+++ branches/upstream/libterm-readline-gnu-perl/current/Makefile.PL Mon May 3 12:56:11 2010
@@ -1,7 +1,7 @@
#
# Makefile.PL for Term::ReadLine::Gnu
#
-# $Id: Makefile.PL,v 1.32 2009/03/01 02:57:15 hiroo Exp $
+# $Id: Makefile.PL,v 1.32 2009-03-01 11:57:15+09 hiroo Exp $
#
# Copyright (c) 2009 Hiroo Hayashi. All rights reserved.
# <hiroo.hayashi at computer.org>
Modified: branches/upstream/libterm-readline-gnu-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-readline-gnu-perl/current/README?rev=57364&op=diff
==============================================================================
--- branches/upstream/libterm-readline-gnu-perl/current/README (original)
+++ branches/upstream/libterm-readline-gnu-perl/current/README Mon May 3 12:56:11 2010
@@ -1,9 +1,9 @@
-*- Indented-text -*-
-$Id: README,v 1.29 2009/03/20 16:37:36 hiroo Exp $
+$Id: README,v 1.30 2010/05/02 10:38:53 hiroo Exp $
Term::ReadLine::Gnu --- GNU Readline Library Wrapper Module
- Copyright (c) 2009 Hiroo Hayashi. All rights reserved.
+ Copyright (c) 2010 Hiroo Hayashi. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
@@ -65,6 +65,17 @@
Revision History:
+
+1.20 2010-05-02
+ - Make a copy of the environment variable array to stop
+ segmentation faults on some systems (ex. FreeBSD)
+ - t/readline.t skip the test of rl_readline_version for GNU
+ Readline Library 6.1 which may return a wrong value
+ - readline-6.1 support
+ new function
+ rl_free_keymap (disabled due to readline-6.1 bug)
+ new variable
+ rl_filename_rewrite_hook (not supported yet)
1.19 2009-03-21
- make sure the outstream fd inside the readline library is in
Modified: branches/upstream/libterm-readline-gnu-perl/current/t/readline.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-readline-gnu-perl/current/t/readline.t?rev=57364&op=diff
==============================================================================
--- branches/upstream/libterm-readline-gnu-perl/current/t/readline.t (original)
+++ branches/upstream/libterm-readline-gnu-perl/current/t/readline.t Mon May 3 12:56:11 2010
@@ -1,9 +1,9 @@
# -*- perl -*-
# readline.t - Test script for Term::ReadLine:GNU
#
-# $Id: readline.t,v 1.46 2009-03-20 23:17:27+09 hiroo Exp $
+# $Id: readline.t,v 1.47 2010/05/02 10:24:59 hiroo Exp $
#
-# Copyright (c) 2008 Hiroo Hayashi. All rights reserved.
+# Copyright (c) 2010 Hiroo Hayashi. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
@@ -91,7 +91,13 @@
my ($maj, $min) = $a->{library_version} =~ /(\d+)\.(\d+)/;
my $version = $a->{readline_version};
-$res = ($version == 0x100 * $maj + $min); ok('readline_version');
+if ($a->{library_version} eq '6.1') {
+ # rl_readline_version returns 0x0600. The bug is fixed GNU Readline 6.1-p2
+ print "ok $n # skipped because GNU Readline Library 6.1 may return wrong value.\n";
+ $n++;
+} else {
+ $res = ($version == 0x100 * $maj + $min); ok('readline_version');
+}
# Version 2.0 is NOT supported.
$res = $version > 0x0200; ok('rl_version');
More information about the Pkg-perl-cvs-commits
mailing list