From: Shlomi Fish Date: Wed, 15 Feb 2012 11:30:32 +0000 (+0100) Subject: Clarify the newSVpvn documentation. X-Git-Tag: v5.15.8~74 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/1876195675e4875a2804e1db82332dbed40b6d98 Clarify the newSVpvn documentation. "string" is now called "buffer", and we mention that it might contain NUL characters. --- diff --git a/sv.c b/sv.c index 214a17d..a6cede7 100644 --- a/sv.c +++ b/sv.c @@ -8387,22 +8387,24 @@ Perl_newSVpv(pTHX_ const char *const s, const STRLEN len) /* =for apidoc newSVpvn -Creates a new SV and copies a string into it. The reference count for the -SV is set to 1. Note that if C is zero, Perl will create a zero length -string. You are responsible for ensuring that the source string is at least -C bytes long. If the C argument is NULL the new SV will be undefined. +Creates a new SV and copies a buffer into it, which may contain NUL characters +(C<\0>) and other binary data. The reference count for the SV is set to 1. +Note that if C is zero, Perl will create a zero length (Perl) string. You +are responsible for ensuring that the source buffer is at least +C bytes long. If the C argument is NULL the new SV will be +undefined. =cut */ SV * -Perl_newSVpvn(pTHX_ const char *const s, const STRLEN len) +Perl_newSVpvn(pTHX_ const char *const buffer, const STRLEN len) { dVAR; register SV *sv; new_SV(sv); - sv_setpvn(sv,s,len); + sv_setpvn(sv,buffer,len); return sv; }