Apd |void |sv_catpvn_flags|NN SV* sv|NN const char* ptr|STRLEN len|I32 flags
Apd |void |sv_catsv_flags |NN SV* dsv|SV* ssv|I32 flags
Apd |STRLEN |sv_utf8_upgrade_flags|NN SV *sv|I32 flags
-Apd |char* |sv_pvn_force_flags|SV* sv|NN STRLEN* lp|I32 flags
+Apd |char* |sv_pvn_force_flags|SV* sv|STRLEN* lp|I32 flags
Apd |void |sv_copypv |NN SV* dsv|NN SV* ssv
Ap |char* |my_atof2 |NN const char *s|NN NV* value
Apn |int |my_socketpair |int family|int type|int protocol|int fd[2]
else if (lvalue) { /* it's an lvalue! */
if (!SvGMAGICAL(sv)) {
if (SvROK(sv)) {
- STRLEN n_a;
- SvPV_force(sv,n_a);
+ SvPV_force_nolen(sv);
if (ckWARN(WARN_SUBSTR))
Perl_warner(aTHX_ packWARN(WARN_SUBSTR),
"Attempt to use reference as lvalue in substr");
}
else {
SV *final = sv_mortalcopy(right);
- STRLEN len, n_a;
+ STRLEN len;
const char *tmps = SvPV(final, len);
sv = sv_mortalcopy(left);
- SvPV_force(sv,n_a);
+ SvPV_force_nolen(sv);
while (!SvNIOKp(sv) && SvCUR(sv) <= len) {
XPUSHs(sv);
if (strEQ(SvPVX_const(sv),tmps))
cx->blk_loop.itermax = SvIV(right);
}
else {
- STRLEN n_a;
cx->blk_loop.iterlval = newSVsv(sv);
- (void) SvPV_force(cx->blk_loop.iterlval,n_a);
+ (void) SvPV_force_nolen(cx->blk_loop.iterlval);
(void) SvPV_nolen_const(right);
}
}
PERL_CALLCONV STRLEN Perl_sv_utf8_upgrade_flags(pTHX_ SV *sv, I32 flags)
__attribute__nonnull__(pTHX_1);
-PERL_CALLCONV char* Perl_sv_pvn_force_flags(pTHX_ SV* sv, STRLEN* lp, I32 flags)
- __attribute__nonnull__(pTHX_2);
-
+PERL_CALLCONV char* Perl_sv_pvn_force_flags(pTHX_ SV* sv, STRLEN* lp, I32 flags);
PERL_CALLCONV void Perl_sv_copypv(pTHX_ SV* dsv, SV* ssv)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2);
sv_force_normal_flags(sv, 0);
if (SvPOK(sv)) {
- *lp = SvCUR(sv);
+ if (lp)
+ *lp = SvCUR(sv);
}
else {
char *s;
-
+ STRLEN len;
+
if (SvREADONLY(sv) && !(flags & SV_MUTABLE_RETURN)) {
if (PL_op)
Perl_croak(aTHX_ "Can't coerce readonly %s to string in %s",
OP_NAME(PL_op));
}
else
- s = sv_2pv_flags(sv, lp, flags);
+ s = sv_2pv_flags(sv, &len, flags);
+ if (lp)
+ *lp = len;
+
if (s != SvPVX_const(sv)) { /* Almost, but not quite, sv_setpvn() */
- const STRLEN len = *lp;
-
if (SvROK(sv))
sv_unref(sv);
SvUPGRADE(sv, SVt_PV); /* Never FALSE */
(const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN))
#define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC)
+#define SvPV_force_nolen(sv) SvPV_force_flags_nolen(sv, SV_GMAGIC)
#define SvPV_force_mutable(sv, lp) SvPV_force_flags_mutable(sv, lp, SV_GMAGIC)
#define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0)
#define SvPV_force_flags(sv, lp, flags) \
((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags))
+#define SvPV_force_flags_nolen(sv, flags) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
+ ? SvPVX(sv) : sv_pvn_force_flags(sv, 0, flags))
#define SvPV_force_flags_mutable(sv, lp, flags) \
((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \