Changeset 145037 for trunk


Ignore:
Timestamp:
Jan 24, 2016, 2:04:38 AM (3 years ago)
Author:
raimue@…
Message:

base: port1.0:
Make handle_option_string remove multiple empty lines to correctly detect
indentation for notes, remove all trailing whitespace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portutil.tcl

    r140488 r145037  
    524524            # args is a list of strings/list
    525525            foreach arg $args {
    526                 # Strip trailing empty lines
    527                 if {[string index $arg 0] eq "\n"} {
    528                     set arg [string range $arg 1 end]
    529                 }
    530                 if {[string index $arg end] eq "\n"} {
    531                     set arg [string range $arg 0 end-1]
    532                 }
     526                # Strip empty lines at beginning
     527                set arg [string trimleft $arg "\n"]
     528                # Strip all trailing whitespace
     529                set arg [string trimright $arg]
    533530
    534531                # Determine indent level
     
    541538                    append indent $c
    542539                }
     540
    543541                # Remove indent on first line
    544542                set arg [string replace $arg 0 [expr {$i - 1}]]
Note: See TracChangeset for help on using the changeset viewer.