summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-03-05 15:56:35 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-03-05 15:56:35 +0000
commit0875d2fe359ba14e879483eafe95813b77c5da09 (patch)
tree27805990140f9c51debeffdf04c0656636a32fe8 /sv.c
parent51ef4e1196e74554150c2d1993b5a0e37f6709c9 (diff)
downloadperl-0875d2fe359ba14e879483eafe95813b77c5da09.tar.gz
Long-standing "defined but not used" SvPVbyte*() are about to get used
for auto-downgrade hooks in gethostbyaddr() etc. (as per Camel-III). Make SvPVbyte*() symmetric with respect to SvPVutf8*() in that: - it does a sv_utf8_downgrade (c.f. SvPVutf8's sv_utf8_upgrade()) - uses SvPV() rather than sv_2pv() in case it isn't a string. p4raw-id: //depot/perlio@9037
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index 4e75506baf..d47a2f5924 100644
--- a/sv.c
+++ b/sv.c
@@ -2884,7 +2884,8 @@ Perl_sv_2pvbyte_nolen(pTHX_ register SV *sv)
char *
Perl_sv_2pvbyte(pTHX_ register SV *sv, STRLEN *lp)
{
- return sv_2pv(sv,lp);
+ sv_utf8_downgrade(sv,0);
+ return SvPV(sv,*lp);
}
char *