summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-10-16 11:09:25 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-10-16 11:09:25 +0000
commitd58bf5aa3d3631a46847733b1ff1985b30140228 (patch)
tree406c095d697ae0ae82bbf187e5c65151bd41232a /sv.c
parentc7848ba184fac8eca4125f4296d6e09fee2c1846 (diff)
parent50e27ac33704d6fb34d4be7cfb426b2097b27505 (diff)
downloadperl-d58bf5aa3d3631a46847733b1ff1985b30140228.tar.gz
Merge maint-5.004 branch (5.004_04) with mainline.
p4raw-id: //depot/perl@137
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/sv.c b/sv.c
index e7d824b273..da4c73d6df 100644
--- a/sv.c
+++ b/sv.c
@@ -3025,7 +3025,7 @@ sv_collxfrm(sv, nxp)
if (SvREADONLY(sv)) {
SAVEFREEPV(xf);
*nxp = xlen;
- return xf;
+ return xf + sizeof(collation_ix);
}
if (! mg) {
sv_magic(sv, 0, 'o', 0, 0);
@@ -3230,8 +3230,8 @@ thats_really_all_folks:
*bp = '\0';
SvCUR_set(sv, bp - (STDCHAR*)SvPVX(sv)); /* set length */
DEBUG_P(PerlIO_printf(Perl_debug_log,
- "Screamer: done, len=%d, string=|%.*s|\n",
- SvCUR(sv),(int)SvCUR(sv),SvPVX(sv)));
+ "Screamer: done, len=%ld, string=|%.*s|\n",
+ (long)SvCUR(sv),(int)SvCUR(sv),SvPVX(sv)));
}
else
{
@@ -4155,7 +4155,6 @@ IV iv;
int sign;
UV uv;
char *p;
- int i;
sv_setpvn(sv, "", 0);
if (iv >= 0) {
@@ -4683,10 +4682,21 @@ sv_vcatpvfn(sv, pat, patlen, args, svargs, svmax, used_locale)
sv_catpv(msg, "end of string");
warn("%_", msg); /* yes, this is reentrant */
}
- /* output mangled stuff */
+
+ /* output mangled stuff ... */
+ if (c == '\0')
+ --q;
eptr = p;
elen = q - p;
- break;
+
+ /* ... right here, because formatting flags should not apply */
+ SvGROW(sv, SvCUR(sv) + elen + 1);
+ p = SvEND(sv);
+ memcpy(p, eptr, elen);
+ p += elen;
+ *p = '\0';
+ SvCUR(sv) = p - SvPVX(sv);
+ continue; /* not "break" */
}
have = esignlen + zeros + elen;