aboutsummaryrefslogtreecommitdiffstats
path: root/testing/cloc/perl522.patch
blob: 31af1bca6923835ef3496e9dedf6aa16b7ea36af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
--- cloc-1.64.orig/cloc
+++ cloc-1.64/cloc
@@ -1281,8 +1281,8 @@
                 $not_Filters_by_Language_Lang_LR = 1;
             }
         } else {
-            if (!defined(@{$Filters_by_Language{$Lang_L} }) or
-                !defined(@{$Filters_by_Language{$Lang_R} })) {
+            if (!(@{$Filters_by_Language{$Lang_L} }) or
+                !(@{$Filters_by_Language{$Lang_R} })) {
                 $not_Filters_by_Language_Lang_LR = 1;
             }
         }
@@ -1618,7 +1618,7 @@
         $Ignored{$file} = "--exclude-lang=$Language{$file}";
         next;
     }
-    my $Filters_by_Language_Language_file = !defined @{$Filters_by_Language{$Language{$file}} };
+    my $Filters_by_Language_Language_file = !@{$Filters_by_Language{$Language{$file}} };
     if ($Filters_by_Language_Language_file) {
         if ($Language{$file} eq "(unknown)") {
             $Ignored{$file} = "language unknown (#1)";
@@ -1759,7 +1759,7 @@
                     if ($PERL_516) {
                         next unless         @{$rhaa_Filters_by_Language->{$1}};
                     } else {
-                        next unless defined @{$rhaa_Filters_by_Language->{$1}};
+                        next unless @{$rhaa_Filters_by_Language->{$1}};
                     }
                     # above test necessary to avoid trying to sum reports
                     # of reports (which have no language breakdown).
@@ -3259,7 +3259,7 @@
 } # 1}}}
 sub print_language_filters {                 # {{{1
     my ($language,) = @_;
-    if (!defined @{$Filters_by_Language{$language}}) {
+    if (!@{$Filters_by_Language{$language}}) {
         warn "Unknown language: $language\n";
         warn "Use --show-lang to list all defined languages.\n";
         return;
@@ -4623,7 +4623,7 @@
 
   open (FILE, $file);
   while (<FILE>) {
-    if (m/^\\begin{code}/) { close FILE; return 2; }
+    if (m/^\\begin\{code}/) { close FILE; return 2; }
     if (m/^>\s/) { close FILE; return 1; }
   }
 
@@ -4652,9 +4652,9 @@
             if (!s/^>//) { s/.*//; }
         } elsif ($literate == 2) {
             if ($inlitblock) {
-                if (m/^\\end{code}/) { s/.*//; $inlitblock = 0; }
+                if (m/^\\end\{code}/) { s/.*//; $inlitblock = 0; }
             } elsif (!$inlitblock) {
-                if (m/^\\begin{code}/) { s/.*//; $inlitblock = 1; }
+                if (m/^\\begin\{code}/) { s/.*//; $inlitblock = 1; }
                 else { s/.*//; }
             }
         }
@@ -6582,7 +6582,7 @@
         my $language = $rh_Language_by_Extension->{$ext};
         next if defined $extension_collisions{$language};
         next if $seen_it{$language};
-        if (!defined @{$rhaa_Filters_by_Language->{$language}}) {
+        if (!@{$rhaa_Filters_by_Language->{$language}}) {
             $OK = 0;
             warn "Missing language filter for $language\n";
         }