chantra / rpms / rpm

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