diff options
-rw-r--r-- | ext/Encode/Changes | 14 | ||||
-rw-r--r-- | ext/Encode/Encode.pm | 4 | ||||
-rw-r--r-- | ext/Encode/Encode.xs | 33 |
3 files changed, 36 insertions, 15 deletions
diff --git a/ext/Encode/Changes b/ext/Encode/Changes index 481e976d62..dcd738410b 100644 --- a/ext/Encode/Changes +++ b/ext/Encode/Changes @@ -1,7 +1,17 @@ # Revision history for Perl extension Encode. # -# $Id: Changes,v 2.35 2009/07/13 02:06:30 dankogai Exp dankogai $ -$Revision: 2.35 $ $Date: 2009/07/13 02:06:30 $ +# $Id: Changes,v 2.37 2009/09/06 14:32:21 dankogai Exp dankogai $ +$Revision: 2.37 $ $Date: 2009/09/06 14:32:21 $ +! Encode.xs + fixed: compilation failure on compilers not supporting C99 + http://rt.cpan.org/Ticket/Display.html?id=49466 + +2.37 2009/09/06 09:03:07 +! Encode.xs + fixed: 'find_encoding("utf8")->decode(undef)' causes segmentation fault + http://rt.cpan.org/Ticket/Display.html?id=49462 + +2.35 2009/07/13 02:06:30 ! lib/Encode/MIME/Header.pm Addressed RT #40027: decode of MIME-Header removes too much whitespace diff --git a/ext/Encode/Encode.pm b/ext/Encode/Encode.pm index 4492164228..749c8f9704 100644 --- a/ext/Encode/Encode.pm +++ b/ext/Encode/Encode.pm @@ -1,10 +1,10 @@ # -# $Id: Encode.pm,v 2.35 2009/07/13 00:49:38 dankogai Exp $ +# $Id: Encode.pm,v 2.37 2009/09/06 14:30:32 dankogai Exp $ # package Encode; use strict; use warnings; -our $VERSION = sprintf "%d.%02d", q$Revision: 2.35 $ =~ /(\d+)/g; +our $VERSION = sprintf "%d.%02d", q$Revision: 2.37 $ =~ /(\d+)/g; sub DEBUG () { 0 } use XSLoader (); XSLoader::load( __PACKAGE__, $VERSION ); diff --git a/ext/Encode/Encode.xs b/ext/Encode/Encode.xs index 1424071f3a..e5f4c9a32d 100644 --- a/ext/Encode/Encode.xs +++ b/ext/Encode/Encode.xs @@ -1,5 +1,5 @@ /* - $Id: Encode.xs,v 2.14 2007/05/29 18:15:32 dankogai Exp $ + $Id: Encode.xs,v 2.16 2009/09/06 14:32:21 dankogai Exp dankogai $ */ #define PERL_NO_GET_CONTEXT @@ -405,18 +405,23 @@ Method_decode_xs(obj,src,check = 0) SV * obj SV * src int check +PREINIT: + STRLEN slen; + U8 *s; + U8 *e; + SV *dst; + bool renewed = 0; CODE: { - STRLEN slen; - U8 *s = (U8 *) SvPV(src, slen); - U8 *e = (U8 *) SvEND(src); - SV *dst = newSV(slen>0?slen:1); /* newSV() abhors 0 -- inaba */ + dSP; ENTER; SAVETMPS; + if (src == &PL_sv_undef) src = newSV(0); + s = (U8 *) SvPV(src, slen); + e = (U8 *) SvEND(src); + dst = newSV(slen>0?slen:1); /* newSV() abhors 0 -- inaba */ /* * PerlIO check -- we assume the object is of PerlIO if renewed */ - bool renewed = 0; - dSP; ENTER; SAVETMPS; PUSHMARK(sp); XPUSHs(obj); PUTBACK; @@ -463,12 +468,18 @@ Method_encode_xs(obj,src,check = 0) SV * obj SV * src int check +PREINIT: + STRLEN slen; + U8 *s; + U8 *e; + SV *dst; + bool renewed = 0; CODE: { - STRLEN slen; - U8 *s = (U8 *) SvPV(src, slen); - U8 *e = (U8 *) SvEND(src); - SV *dst = newSV(slen>0?slen:1); /* newSV() abhors 0 -- inaba */ + if (src == &PL_sv_undef) src = newSV(0); + s = (U8 *) SvPV(src, slen); + e = (U8 *) SvEND(src); + dst = newSV(slen>0?slen:1); /* newSV() abhors 0 -- inaba */ if (SvUTF8(src)) { /* Already encoded */ if (strict_utf8(aTHX_ obj)) { |