summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorChip Salzenberg <chip@pobox.com>1998-03-03 04:39:49 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-03-03 04:39:49 +0000
commit93233ece75d8fe98a77377e72c4d6004c5ea8691 (patch)
treed9de53b8b818671b4e52497a2397cde5a6e8950e /gv.c
parent2c4aebbdec0f7c22369f4986d7cad0139e4dd272 (diff)
downloadperl-93233ece75d8fe98a77377e72c4d6004c5ea8691.tar.gz
[win32] merge problematic maintpatch to op.c
#77: "Eliminate double warnings under C<package;>" Files: gv.c op.c toke.c p4raw-id: //depot/win32/perl@641
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/gv.c b/gv.c
index c0c671d10b..128d790492 100644
--- a/gv.c
+++ b/gv.c
@@ -530,7 +530,9 @@ gv_fetchpv(char *nambeg, I32 add, I32 sv_type)
/* By this point we should have a stash and a name */
if (!stash) {
- if (add) {
+ if (!add)
+ return Nullgv;
+ if (add & ~2) {
char sv_type_char = ((sv_type == SVt_PV) ? '$'
: (sv_type == SVt_PVAV) ? '@'
: (sv_type == SVt_PVHV) ? '%'
@@ -539,16 +541,15 @@ gv_fetchpv(char *nambeg, I32 add, I32 sv_type)
warn("Global symbol \"%c%s\" requires explicit package name",
sv_type_char, name);
else
- warn("Global symbol \"%s\" requires explicit package name", name);
- ++error_count;
- stash = curstash ? curstash : defstash; /* avoid core dumps */
- add_gvflags = ((sv_type == SVt_PV) ? GVf_IMPORTED_SV
- : (sv_type == SVt_PVAV) ? GVf_IMPORTED_AV
- : (sv_type == SVt_PVHV) ? GVf_IMPORTED_HV
- : 0);
+ warn("Global symbol \"%s\" requires explicit package name",
+ name);
}
- else
- return Nullgv;
+ ++error_count;
+ stash = curstash ? curstash : defstash; /* avoid core dumps */
+ add_gvflags = ((sv_type == SVt_PV) ? GVf_IMPORTED_SV
+ : (sv_type == SVt_PVAV) ? GVf_IMPORTED_AV
+ : (sv_type == SVt_PVHV) ? GVf_IMPORTED_HV
+ : 0);
}
if (!SvREFCNT(stash)) /* symbol table under destruction */