develooper Front page | perl.perl5.changes | Postings from January 2019

[perl.git] branch blead updated. v5.29.7-33-gbbe6f202f7

From:
Chris 'Bingos' Williams
Date:
January 31, 2019 09:44
Subject:
[perl.git] branch blead updated. v5.29.7-33-gbbe6f202f7
Message ID:
E1gp8tX-0006MR-TY@git.dc.perl.space
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/bbe6f202f7bf0108cfc3bc44dbab7be65c113ce2?hp=e8db349f5c61708301fd5463e49bfe95c448dd6d>

- Log -----------------------------------------------------------------
commit bbe6f202f7bf0108cfc3bc44dbab7be65c113ce2
Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
Date:   Thu Jan 31 09:12:29 2019 +0000

    Update Encode to CPAN version 3.00
    
      [DELTA]
    
    $Revision: 3.00 $ $Date: 2019/01/31 04:51:32 $
    ! Encode.pm
      VERSION bumped to 3.00 to make PAUSE happy
    
    2.100 2019/01/31 04:26:40
    !  Encode.xs MANIFEST
    +  t/xml.t
      Pulled: Do not access SV* buffer if we have not called SvPV_force()
      https://github.com/dankogai/p5-encode/pull/137
    ! MANIFEST
      remove utf8messages.t which is already deleted from the repository.

-----------------------------------------------------------------------

Summary of changes:
 MANIFEST                  |  1 +
 Porting/Maintainers.pl    |  2 +-
 cpan/Encode/Encode.pm     |  4 ++--
 cpan/Encode/Encode.xs     | 28 ++++++++++------------------
 cpan/Encode/t/decode.t    |  2 +-
 cpan/Encode/t/enc_eucjp.t |  2 +-
 cpan/Encode/t/xml.t       | 22 ++++++++++++++++++++++
 7 files changed, 38 insertions(+), 23 deletions(-)
 create mode 100644 cpan/Encode/t/xml.t

diff --git a/MANIFEST b/MANIFEST
index ec6ee36963..c954476faa 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -634,6 +634,7 @@ cpan/Encode/t/utf8strict.t		test script
 cpan/Encode/t/utf8warnings.t
 cpan/Encode/t/whatwg-aliases.json
 cpan/Encode/t/whatwg-aliases.t
+cpan/Encode/t/xml.t
 cpan/Encode/TW/Makefile.PL		Encode extension
 cpan/Encode/TW/TW.pm			Encode extension
 cpan/Encode/ucm/8859-1.ucm		Unicode Character Map
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index a76d9cf16a..e88b33d79e 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -386,7 +386,7 @@ use File::Glob qw(:case);
     },
 
     'Encode' => {
-        'DISTRIBUTION' => 'DANKOGAI/Encode-2.99.tar.gz',
+        'DISTRIBUTION' => 'DANKOGAI/Encode-3.00.tar.gz',
         'FILES'        => q[cpan/Encode],
     },
 
diff --git a/cpan/Encode/Encode.pm b/cpan/Encode/Encode.pm
index ec625b9f20..6d240b3bc1 100644
--- a/cpan/Encode/Encode.pm
+++ b/cpan/Encode/Encode.pm
@@ -1,5 +1,5 @@
 #
-# $Id: Encode.pm,v 2.99 2019/01/21 03:11:41 dankogai Exp $
+# $Id: Encode.pm,v 3.00 2019/01/31 04:49:28 dankogai Exp $
 #
 package Encode;
 use strict;
@@ -7,7 +7,7 @@ use warnings;
 use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
 our $VERSION;
 BEGIN {
-    $VERSION = sprintf "%d.%02d", q$Revision: 2.99 $ =~ /(\d+)/g;
+    $VERSION = sprintf "%d.%02d", q$Revision: 3.00 $ =~ /(\d+)/g;
     require XSLoader;
     XSLoader::load( __PACKAGE__, $VERSION );
 }
diff --git a/cpan/Encode/Encode.xs b/cpan/Encode/Encode.xs
index ddc1b1f366..30fbeaba5f 100644
--- a/cpan/Encode/Encode.xs
+++ b/cpan/Encode/Encode.xs
@@ -1,5 +1,5 @@
 /*
- $Id: Encode.xs,v 2.45 2019/01/21 03:13:35 dankogai Exp $
+ $Id: Encode.xs,v 2.46 2019/01/31 04:26:40 dankogai Exp $
  */
 
 #define PERL_NO_GET_CONTEXT
@@ -148,6 +148,7 @@ encode_method(pTHX_ const encode_t * enc, const encpage_t * dir, SV * src, U8 *
 	      IV check, STRLEN * offset, SV * term, int * retcode, 
 	      SV *fallback_cb)
 {
+    U8 *sorig    = s;
     STRLEN tlen  = slen;
     STRLEN ddone = 0;
     STRLEN sdone = 0;
@@ -309,7 +310,7 @@ encode_method(pTHX_ const encode_t * enc, const encpage_t * dir, SV * src, U8 *
         /* settle variables when fallback */
         d    = (U8 *)SvEND(dst);
         dlen = SvLEN(dst) - ddone - 1;
-        s    = (U8*)SvPVX(src) + sdone;
+        s    = sorig + sdone;
         slen = tlen - sdone;
         break;
 
@@ -322,12 +323,9 @@ encode_method(pTHX_ const encode_t * enc, const encpage_t * dir, SV * src, U8 *
     }   /* End of looping through the string */
  ENCODE_SET_SRC:
     if (check && !(check & ENCODE_LEAVE_SRC)){
-    sdone = SvCUR(src) - (slen+sdone);
-    if (sdone) {
+        sdone = tlen - (slen+sdone);
         sv_setpvn(src, (char*)s+slen, sdone);
-    }
-    SvCUR_set(src, sdone);
-    SvSETMAGIC(src);
+        SvSETMAGIC(src);
     }
     /* warn("check = 0x%X, code = 0x%d\n", check, code); */
 
@@ -335,7 +333,7 @@ encode_method(pTHX_ const encode_t * enc, const encpage_t * dir, SV * src, U8 *
     SvPOK_only(dst);
 
 #if ENCODE_XS_PROFILE
-    if (SvCUR(dst) > SvCUR(src)){
+    if (SvCUR(dst) > tlen){
     Perl_warn(aTHX_
           "SvLEN(dst)=%d, SvCUR(dst)=%d. %d bytes unused(%f %%)\n",
           SvLEN(dst), SvCUR(dst), SvLEN(dst) - SvCUR(dst),
@@ -666,12 +664,9 @@ PPCODE:
 
     /* Clear out translated part of source unless asked not to */
     if (modify) {
-    slen = e-s;
-    if (slen) {
+        slen = e-s;
         sv_setpvn(src, (char*)s, slen);
-    }
-    SvCUR_set(src, slen);
-    SvSETMAGIC(src);
+        SvSETMAGIC(src);
     }
     SvUTF8_on(dst);
     if (SvTAINTED(src)) SvTAINTED_on(dst); /* propagate taintedness */
@@ -736,12 +731,9 @@ PPCODE:
 
     /* Clear out translated part of source unless asked not to */
     if (modify) {
-    slen = e-s;
-    if (slen) {
+        slen = e-s;
         sv_setpvn(src, (char*)s, slen);
-    }
-    SvCUR_set(src, slen);
-    SvSETMAGIC(src);
+        SvSETMAGIC(src);
     }
     SvPOK_only(dst);
     SvUTF8_off(dst);
diff --git a/cpan/Encode/t/decode.t b/cpan/Encode/t/decode.t
index 0c3b6697f4..66723f4423 100644
--- a/cpan/Encode/t/decode.t
+++ b/cpan/Encode/t/decode.t
@@ -1,5 +1,5 @@
 #
-# $Id: decode.t,v 1.4 2017/10/06 22:21:53 dankogai Exp $
+# $Id: decode.t,v 1.5 2019/01/31 04:26:40 dankogai Exp $
 #
 use strict;
 use Encode qw(decode_utf8 FB_CROAK find_encoding decode);
diff --git a/cpan/Encode/t/enc_eucjp.t b/cpan/Encode/t/enc_eucjp.t
index 8f933b0063..84548af0d6 100644
--- a/cpan/Encode/t/enc_eucjp.t
+++ b/cpan/Encode/t/enc_eucjp.t
@@ -1,4 +1,4 @@
-# $Id: enc_eucjp.t,v 2.5 2017/06/10 17:23:50 dankogai Exp $
+# $Id: enc_eucjp.t,v 2.6 2019/01/31 04:26:40 dankogai Exp $
 # This is the twin of enc_utf8.t .
 
 BEGIN {
diff --git a/cpan/Encode/t/xml.t b/cpan/Encode/t/xml.t
new file mode 100644
index 0000000000..2c7e721d91
--- /dev/null
+++ b/cpan/Encode/t/xml.t
@@ -0,0 +1,22 @@
+use strict;
+use warnings;
+
+use Encode;
+use Test::More;
+
+my $content = String->new("--\x{30c6}--");
+my $text = Encode::encode('latin1', $content, Encode::FB_XMLCREF);
+is $text, "--&#x30c6;--";
+
+done_testing;
+
+package String;
+use overload
+  '""' => sub { ${$_[0]} }, fallback => 1;
+
+sub new {
+    my($class, $str) = @_;
+    bless \$str, $class;
+}
+
+1;

-- 
Perl5 Master Repository



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About