# 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
#
-# $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 );
/*
- $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
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;
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)) {