=for apidoc gv_stashpv
Returns a pointer to the stash for a specified package. C<name> should
-be a valid UTF-8 string. If C<create> is set then the package will be
-created if it does not already exist. If C<create> is not set and the
-package does not exist then NULL is returned.
+be a valid UTF-8 string and must be null-terminated. If C<create> is set
+then the package will be created if it does not already exist. If C<create>
+is not set and the package does not exist then NULL is returned.
=cut
*/
return gv_stashpvn(name, strlen(name), create);
}
+/*
+=for apidoc gv_stashpvn
+
+Returns a pointer to the stash for a specified package. C<name> should
+be a valid UTF-8 string. The C<namelen> parameter indicates the length of
+the C<name>, in bytes. If C<create> is set then the package will be
+created if it does not already exist. If C<create> is not set and the
+package does not exist then NULL is returned.
+
+=cut
+*/
+
HV*
Perl_gv_stashpvn(pTHX_ const char *name, U32 namelen, I32 create)
{
name = "__ANON__";
if (keepmain || strNE(name, "main")) {
- Perl_sv_catpvf(aTHX_ sv,"%s::", name);
+ sv_catpv(sv,name);
+ sv_catpvn(sv,"::", 2);
}
sv_catpvn(sv,GvNAME(gv),GvNAMELEN(gv));
}