[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 05/06: c/cruft: Remove unused capture groups and add some spaces to regex



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit 62ae4fd53f9339002ad17763446f56c41c353e0d
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Sep 6 11:48:35 2015 +0200

    c/cruft: Remove unused capture groups and add some spaces to regex
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/cruft.pm | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/checks/cruft.pm b/checks/cruft.pm
index 43a4c35..416e01e 100644
--- a/checks/cruft.pm
+++ b/checks/cruft.pm
@@ -972,16 +972,15 @@ sub _linelength_test {
         # strip indention
         $strip =~ s/^\s+//g;
         # from perl faq strip comments
-        $strip =~ s#
-                     /\*[^*]*+\*++([^/*][^*]*+\*++)*/
-
-                  |  //([^\\]|[^\n][\n]?)*?(?=\n)
+        $strip =~ s{
+                     /\* [^*]*+ \*++ (?: [^/*][^*]*+\*++ ) */
+                  |  // (?: [^\\] | [^\n][\n]? )*? (?=\n)
                   |  (
-                         "(\\.|[^"\\]++)*"
-                       | '(\\.|[^'\\]++)*'
+                         "(?: \\. | [^"\\]++)*"
+                       | '(?: \\. | [^'\\]++)*'
                        | .[^/"'\\]*+
                      )
-                   #defined $3 ? $3 : ""#xgse;
+                   }{defined $1 ? $1 : ""}xgse;
         # strip empty line
         $strip =~ s/^\s*\n//mg;
         # remove last \n

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: