This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c8e4cf8
)
Perl_sv_chop() can return early if it's being asked to do nothing.
author
Nicholas Clark
<nick@ccl4.org>
Sat, 29 Dec 2007 13:33:38 +0000
(13:33 +0000)
committer
Nicholas Clark
<nick@ccl4.org>
Sat, 29 Dec 2007 13:33:38 +0000
(13:33 +0000)
p4raw-id: //depot/perl@32763
sv.c
patch
|
blob
|
blame
|
history
diff --git
a/sv.c
b/sv.c
index
3e7c3ff
..
913a5da
100644
(file)
--- a/
sv.c
+++ b/
sv.c
@@
-4211,6
+4211,10
@@
Perl_sv_chop(pTHX_ register SV *sv, register const char *ptr)
if (!ptr || !SvPOKp(sv))
return;
delta = ptr - SvPVX_const(sv);
+ if (!delta) {
+ /* Nothing to do. */
+ return;
+ }
SV_CHECK_THINKFIRST(sv);
if (SvTYPE(sv) < SVt_PVIV)
sv_upgrade(sv,SVt_PVIV);