Blame SOURCES/perl-5.27.1-perl-131679-Fix-our-sub-foo-bar-message.patch

243a19
From b9a58d500dd75ba783abac92a56e57d41227f62b Mon Sep 17 00:00:00 2001
243a19
From: Father Chrysostomos <sprout@cpan.org>
243a19
Date: Sun, 2 Jul 2017 11:35:20 -0700
243a19
Subject: [PATCH] =?UTF-8?q?[perl=20#131679]=20Fix=20=E2=80=98our=20sub=20f?=
243a19
 =?UTF-8?q?oo::bar=E2=80=99=20message?=
243a19
MIME-Version: 1.0
243a19
Content-Type: text/plain; charset=UTF-8
243a19
Content-Transfer-Encoding: 8bit
243a19
243a19
It should say subroutine, not variable.
243a19
243a19
Signed-off-by: Petr Písař <ppisar@redhat.com>
243a19
---
243a19
 t/lib/croak/toke | 6 ++++++
243a19
 toke.c           | 3 ++-
243a19
 2 files changed, 8 insertions(+), 1 deletion(-)
243a19
243a19
diff --git a/t/lib/croak/toke b/t/lib/croak/toke
243a19
index 7aa15ef..2603224 100644
243a19
--- a/t/lib/croak/toke
243a19
+++ b/t/lib/croak/toke
243a19
@@ -133,6 +133,12 @@ state sub;
243a19
 EXPECT
243a19
 Missing name in "state sub" at - line 2.
243a19
 ########
243a19
+# NAME our sub pack::foo
243a19
+our sub foo::bar;
243a19
+EXPECT
243a19
+No package name allowed for subroutine &foo::bar in "our" at - line 1, near "our sub foo::bar"
243a19
+Execution of - aborted due to compilation errors.
243a19
+########
243a19
 # NAME my sub pack::foo
243a19
 use feature 'lexical_subs', 'state';
243a19
 my sub foo::bar;
243a19
diff --git a/toke.c b/toke.c
243a19
index ace92e3..6aa5f26 100644
243a19
--- a/toke.c
243a19
+++ b/toke.c
243a19
@@ -8848,7 +8848,8 @@ S_pending_ident(pTHX)
243a19
         if (PL_in_my == KEY_our) {	/* "our" is merely analogous to "my" */
243a19
             if (has_colon)
243a19
                 yyerror_pv(Perl_form(aTHX_ "No package name allowed for "
243a19
-                                  "variable %s in \"our\"",
243a19
+                                  "%se %s in \"our\"",
243a19
+                                  *PL_tokenbuf=='&' ?"subroutin":"variabl",
243a19
                                   PL_tokenbuf), UTF ? SVf_UTF8 : 0);
243a19
             tmp = allocmy(PL_tokenbuf, tokenbuf_len, UTF ? SVf_UTF8 : 0);
243a19
         }
243a19
-- 
243a19
2.9.4
243a19