summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-11-18 16:46:11 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-18 16:46:11 +0000
commitf36eea1037c5e636f0a49c0b179f8f7dce70d331 (patch)
treeb7eecbb9d21bf212faae2229aa307213f67c10b0
parent619af6b4ca148b0cfb9a0e8c2a616b34b88e0cc2 (diff)
downloadperl-f36eea1037c5e636f0a49c0b179f8f7dce70d331.tar.gz
All of syswrite/send/sendto need to return character counts,
and character counts from the offset, not the beginning of the scalar. p4raw-id: //depot/perl@13076
-rw-r--r--pp_sys.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/pp_sys.c b/pp_sys.c
index a333b1053a..bf2b3522e0 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1842,9 +1842,6 @@ PP(pp_send)
/* See the note at doio.c:do_print about filesize limits. --jhi */
retval = PerlLIO_write(PerlIO_fileno(IoIFP(io)),
buffer, length);
- if (DO_UTF8(bufsv))
- retval = utf8_length((U8*)SvPVX(bufsv),
- (U8*)SvPVX(bufsv) + retval);
}
}
#ifdef HAS_SOCKET
@@ -1866,6 +1863,8 @@ PP(pp_send)
if (retval < 0)
goto say_undef;
SP = ORIGMARK;
+ if (DO_UTF8(bufsv))
+ retval = utf8_length((U8*)buffer, (U8*)buffer + retval);
#if Size_t_size > IVSIZE
PUSHn(retval);
#else