File: 0006-Better-line-number-tracking.patch

package info (click to toggle)
libparse-debcontrol-perl 2.005-4.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 384 kB
  • sloc: perl: 910; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 671 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From f80ef7038b36985780e13af1694df9a47a77afc6 Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima@secretsauce.net>
Date: Thu, 2 Aug 2012 17:14:13 -0700
Subject: [PATCH] Fixed improperly-handled comment stripping

--- a/lib/Parse/DebControl.pm
+++ b/lib/Parse/DebControl.pm
@@ -379,6 +379,8 @@ sub _parseDataHandle
 
 	foreach my $line (<$handle>)
 	{
+		$linenum++;
+
 		#Sometimes with IO::Scalar, lines may have a newline at the end
 
 		#$line =~ s/\r??\n??$//; #CRLF fix, but chomp seems to clean it
@@ -406,7 +408,6 @@ sub _parseDataHandle
             $line =~ s/\#\#/\#/;
         }
 
-		$linenum++;
 		if($line =~ /^[^\t\s]/)
 		{
 			#we have a valid key-value pair