projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
83d6f15
)
XS::APItest: Flatten src for utf16_to_utf8_reversed
author
Father Chrysostomos
<sprout@cpan.org>
Thu, 12 Dec 2013 23:26:01 +0000
(15:26 -0800)
committer
Father Chrysostomos
<sprout@cpan.org>
Fri, 17 Jan 2014 01:58:37 +0000
(17:58 -0800)
utf16_to_utf8_reversed (the C function) modifies its input, so the XS
function of the same name should flatten the input to avoid modifying
shared buffers.
Brought to you by PERL_DEBUG_READONLY_COW.
ext/XS-APItest/APItest.xs
patch
|
blob
|
history
diff --git
a/ext/XS-APItest/APItest.xs
b/ext/XS-APItest/APItest.xs
index
1b8ec3f
..
f8fc1bf
100644
(file)
--- a/
ext/XS-APItest/APItest.xs
+++ b/
ext/XS-APItest/APItest.xs
@@
-2480,6
+2480,7
@@
utf16_to_utf8 (sv, ...)
SV *dest;
I32 got; /* Gah, badly thought out APIs */
CODE:
+ if (ix) (void)SvPV_force_nolen(sv);
source = (U8 *)SvPVbyte(sv, len);
/* Optionally only convert part of the buffer. */
if (items > 1) {