Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/misc.tcl part of check-in [4e49cbf03b] - New helper command to delete item from list by name instead of position. by aku on 2007-10-17 03:08:06. [view]

To:

File tools/cvs2fossil/lib/misc.tcl part of check-in [9f3fd3ec4b] - Added a bit of path normalization, stripping of a trailing slash from the path to the cvs repository. Before such a slash could break a later coming fileutil::stripPath. by aku on 2007-10-23 04:34:12. [view]

@@ -59,16 +59,21 @@
     }
 
     # Delete item from list by name
 
+    proc striptrailingslash {path} {
+	# split and rejoin gets rid of a traling / character.
+	return [eval [linsert [file split $path] 0 file join]]
+    }
+
     # # ## ### ##### ######## #############
 }
 
 namespace eval ::vc::tools::misc {
-    namespace export sp nsp max ldelete
+    namespace export sp nsp max ldelete striptrailingslash
 }
 
 # -----------------------------------------------------------------------------
 # Ready
 
 package provide vc::tools::misc 1.0
 return