Changeset 1450 for trunk/base


Ignore:
Timestamp:
Dec 17, 2002, 2:20:10 PM (17 years ago)
Author:
landonf (Landon Fuller)
Message:

Merge in regex escaping fixes from landonf-1.0

Location:
trunk/base/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port/port.tcl

    r1363 r1450  
    153153        set target $action
    154154        if {[info exists portname]} {
    155             if {[catch {set res [dportsearch ^$portname\$]} result]} {
     155            # Escape regex special characters
     156            regsub -all "(\\(){1}|(\\)){1}|(\\{1}){1}|(\\+){1}|(\\{1}){1}|(\\{){1}|(\\}){1}|(\\^){1}|(\\$){1}|(\\.){1}|(\\\\){1}" $portname "\\\\&" search_string
     157            if {[catch {set res [dportsearch ^$search_string\$]} result]} {
    156158                puts $result
    157159                exit 1
  • trunk/base/src/port1.0/portutil.tcl

    r1443 r1450  
    10851085        set options(workpath) ${newworkpath}
    10861086    }
    1087        
    1088     set res [dportsearch ^$portname\$]
     1087
     1088        # Escape regex special characters
     1089        regsub -all "(\\(){1}|(\\)){1}|(\\{1}){1}|(\\+){1}|(\\{1}){1}|(\\{){1}|(\\}){1}|(\\^){1}|(\\$){1}|(\\.){1}|(\\\\){1}" $portname "\\\\&" search_string
     1090
     1091    set res [dportsearch ^$search_string\$]
    10891092    if {[llength $res] < 2} {
    10901093        ui_error "Portfile $portname not found"
Note: See TracChangeset for help on using the changeset viewer.