Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Feb 2013 19:49:03 +0000 (UTC)
From:      Chris Rees <crees@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r247235 - user/crees/rclint
Message-ID:  <201302241949.r1OJn3m6062407@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: crees (ports committer)
Date: Sun Feb 24 19:49:02 2013
New Revision: 247235
URL: http://svnweb.freebsd.org/changeset/base/247235

Log:
  Actually check shebang

Modified:
  user/crees/rclint/rclint.py

Modified: user/crees/rclint/rclint.py
==============================================================================
--- user/crees/rclint/rclint.py	Sun Feb 24 19:32:43 2013	(r247234)
+++ user/crees/rclint/rclint.py	Sun Feb 24 19:49:02 2013	(r247235)
@@ -193,7 +193,7 @@ class Comment:
 class Shebang:
     def __init__(self, comment):
         self.line = comment.line
-        result = comment.match(r'#!(\S+)\s*(.*)')
+        result = comment.match(r'^#!(\S+)\s*(.*)')
         if result:
             self.value = result[0]
             self.args = result[1]
@@ -323,7 +323,7 @@ def do_rclint(filename):
     logging.debug('OK, done collecting variables.  Time to check!')
 
     logging.debug('Checking shebang')
-    if len(lineobj['Shebang']) < 1:
+    if lineobj['Shebang'][0].value == False:
         error.give('shebang')
 
     logging.debug('Checking RcsId')



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302241949.r1OJn3m6062407>