File: 0015-haskell_count-Unescaped-left-brace-in-regex-is-passe.patch

package info (click to toggle)
sloccount 2.26%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,800 kB
  • sloc: perl: 2,198; ansic: 622; sh: 537; lex: 254; makefile: 167; ruby: 110; python: 96; haskell: 32; cobol: 27; php: 22; pascal: 10; xml: 7; fortran: 6; f90: 6; cs: 5
file content (34 lines) | stat: -rw-r--r-- 1,073 bytes parent folder | download
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
From: =?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz>
Date: Sat, 24 May 2025 20:05:22 +0200
Subject: haskell_count: Unescaped left brace in regex is passed through in
 regex errors

---
 haskell_count | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/haskell_count b/haskell_count
index 21299aa..ce48d3f 100755
--- a/haskell_count
+++ b/haskell_count
@@ -70,7 +70,7 @@ sub determine_lit_type {
 
   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; }
   }
 
@@ -92,9 +92,9 @@ sub count_file {
       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/.*//; }
       }
     }