ad_partner_shorten_url_stub

one of the documented procedures in this installation of the ACS
Usage:
ad_partner_shorten_url_stub   stub
What it does:
Pulls off the last directory in the specified stub (e.g. /volunteer/register --> /volunteer
Defined 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


philg@mit.edu