chantra / rpms / rpm

Forked from rpms/rpm 2 years ago
Clone
2a5b6a
From 4f05fa0e15bcb66d29f89e28829ea43107f6382b Mon Sep 17 00:00:00 2001
2a5b6a
From: Lubos Kardos <lkardos@redhat.com>
2a5b6a
Date: Mon, 1 Dec 2014 16:04:32 +0100
2a5b6a
Subject: [PATCH 1/2] Fix parsing multi-line print statement with unquoted tag
2a5b6a
2a5b6a
- script perl.req was able to parse only multi-line print statements
2a5b6a
  with quoted tag e.g. 'print <<"tag"' or "print <<'tag'". Now it can
2a5b6a
  also parse "print <
2a5b6a
---
2a5b6a
 scripts/perl.req | 4 ++--
2a5b6a
 1 file changed, 2 insertions(+), 2 deletions(-)
2a5b6a
2a5b6a
diff --git a/scripts/perl.req b/scripts/perl.req
2a5b6a
index 04f822c..e17ad5a 100755
2a5b6a
--- a/scripts/perl.req
2a5b6a
+++ b/scripts/perl.req
2a5b6a
@@ -165,8 +165,8 @@ sub process_file {
2a5b6a
     #
2a5b6a
     if ( m/print(\s+|\s+\S+\s+)\<\<(.*)/g ) {
2a5b6a
         my $tag = $2;
2a5b6a
-        $tag =~ s/^\s*['"]//;       # strip off leading space and quote
2a5b6a
-        $tag =~ s/["']\s*;\s*$//;   # strip off trailing quote and space and semicolon
2a5b6a
+        $tag =~ s/^\s*['"]?//;       # strip off leading space and quote
2a5b6a
+        $tag =~ s/["']?\s*;\s*$//;   # strip off trailing quote and space and semicolon
2a5b6a
         while (<FILE>) {
2a5b6a
             chomp;
2a5b6a
             ( $_ eq $tag ) && last;
2a5b6a
-- 
2a5b6a
2.5.5
2a5b6a