ad_partner_shorten_url_stub stubWhat it does:
Pulls off the last directory in the specified stub (e.g. /volunteer/register --> /volunteerDefined in: /web/philip/tcl/ad-partner-defs.tcl
Source code:
if { [empty_string_p $stub] || [string compare $stub "/"] == 0 } {
return ""
}
set stub_pieces [split $stub "/"]
set length [llength $stub_pieces]
set new_stub ""
for { set i 0 } { $i < [expr $length - 1] } { incr i } {
if { ![empty_string_p [lindex $stub_pieces $i]] } {
append new_stub "/[lindex $stub_pieces $i]"
}
}
# ns_log Notice "Shortening $stub to $new_stub"
# We must have started with a directory name (e.g. /volunteer) in which
# case / is the parent
if { [empty_string_p $new_stub] } {
return "/"
}
return $new_stub