summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gv.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gv.c b/gv.c
index 23700a0106..1bc8bf2d9d 100644
--- a/gv.c
+++ b/gv.c
@@ -1009,7 +1009,6 @@ GV *
Perl_gv_fetchmethod_pvn_flags(pTHX_ HV *stash, const char *name, const STRLEN len, U32 flags)
{
const char *nend;
- const char * const name_end= name + len;
const char *nsplit = NULL;
GV* gv;
HV* ostash = stash;
@@ -1029,15 +1028,15 @@ Perl_gv_fetchmethod_pvn_flags(pTHX_ HV *stash, const char *name, const STRLEN le
the error reporting code. */
}
- for (nend = name; nend < name_end && *nend; nend++) {
+ for (nend = name; *nend || nend != (origname + len); nend++) {
if (*nend == '\'') {
nsplit = nend;
name = nend + 1;
}
- else if (*nend == ':' && nend+1 < name_end && *(nend + 1) == ':') {
- nsplit = nend++;
- name = nend + 1;
- }
+ else if (*nend == ':' && *(nend + 1) == ':') {
+ nsplit = nend++;
+ name = nend + 1;
+ }
}
if (nsplit) {
if ((nsplit - origname) == 5 && memEQ(origname, "SUPER", 5)) {