From 859969241a8695e306789ed30659d05571db8fe2 Mon Sep 17 00:00:00 2001 From: gfx Date: Wed, 15 Sep 2010 13:20:20 +0900 Subject: [PATCH] Tweaks --- perl/xs-src/unpack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl/xs-src/unpack.c b/perl/xs-src/unpack.c index 5e757173..78942233 100644 --- a/perl/xs-src/unpack.c +++ b/perl/xs-src/unpack.c @@ -190,8 +190,8 @@ STATIC_INLINE int template_callback_map_item(unpack_user* u PERL_UNUSED_DECL, SV STATIC_INLINE int template_callback_raw(unpack_user* u PERL_UNUSED_DECL, const char* b PERL_UNUSED_DECL, const char* p, unsigned int l, SV** o) { dTHX; - /* *o = newSVpvn_flags(p, l, SVs_TEMP); <= this does not work. */ - *o = sv_2mortal((l==0) ? newSVpv("", 0) : newSVpv(p, l)); + /* newSVpvn_flags(p, l, SVs_TEMP) returns an undef if l == 0 */ + *o = ((l==0) ? newSVpvs_flags("", SVs_TEMP) : newSVpvn_flags(p, l, SVs_TEMP)); return 0; }