[33705] trunk/base/src/port1.0/portlint.tcl

ryandesign at macports.org ryandesign at macports.org
Sun Feb 3 11:17:07 PST 2008


Revision: 33705
          http://trac.macosforge.org/projects/macports/changeset/33705
Author:   ryandesign at macports.org
Date:     2008-02-03 11:17:05 -0800 (Sun, 03 Feb 2008)

Log Message:
-----------
Make trailing whitespace check more elegant, and thus also fix the erroneous warning printed when an otherwise empty line ends with trailing spaces; this corrects the fix originally made in r28568; see #14165.

Modified Paths:
--------------
    trunk/base/src/port1.0/portlint.tcl

Modified: trunk/base/src/port1.0/portlint.tcl
===================================================================
--- trunk/base/src/port1.0/portlint.tcl	2008-02-03 18:54:14 UTC (rev 33704)
+++ trunk/base/src/port1.0/portlint.tcl	2008-02-03 19:17:05 UTC (rev 33705)
@@ -200,8 +200,7 @@
         }
         set require_blank false
 
-        if {[string match "* " $line] || [string match "*\t" $line] &&
-            [string trim $line] != "" } {
+        if {[regexp {\S[ \t]+$} $line]} {
             # allow indented blank lines between blocks of code and such
             ui_warn "Line $lineno has trailing whitespace before newline"
             incr warnings

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080203/09967abc/attachment.html


More information about the macports-changes mailing list