Skip to content
Permalink
Browse files

Merge in regex escaping fixes from landonf-1.0

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@1450 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
landonf committed Dec 17, 2002
1 parent 78f93ec commit 9dbd5140b60bf524a377f19f07a8c774f7123fb4
Showing with 8 additions and 3 deletions.
  1. +3 −1 src/port/port.tcl
  2. +5 −2 src/port1.0/portutil.tcl
@@ -152,7 +152,9 @@ switch -- $action {
default {
set target $action
if {[info exists portname]} {
if {[catch {set res [dportsearch ^$portname\$]} result]} {
# Escape regex special characters
regsub -all "(\\(){1}|(\\)){1}|(\\{1}){1}|(\\+){1}|(\\{1}){1}|(\\{){1}|(\\}){1}|(\\^){1}|(\\$){1}|(\\.){1}|(\\\\){1}" $portname "\\\\&" search_string
if {[catch {set res [dportsearch ^$search_string\$]} result]} {
puts $result
exit 1
}
@@ -1084,8 +1084,11 @@ proc portexec_int {portname target {newworkpath ""}} {
} else {
set options(workpath) ${newworkpath}
}

set res [dportsearch ^$portname\$]

# Escape regex special characters
regsub -all "(\\(){1}|(\\)){1}|(\\{1}){1}|(\\+){1}|(\\{1}){1}|(\\{){1}|(\\}){1}|(\\^){1}|(\\$){1}|(\\.){1}|(\\\\){1}" $portname "\\\\&" search_string

set res [dportsearch ^$search_string\$]
if {[llength $res] < 2} {
ui_error "Portfile $portname not found"
return -1

0 comments on commit 9dbd514

Please sign in to comment.
You can’t perform that action at this time.