diff --git a/vcsh b/vcsh
index b03df7aaca40292c9a15c8e3a4565ffbbc5ae80c..c9c706b06a220435f55f9c579eec2c3cec9d59cb 100755
--- a/vcsh
+++ b/vcsh
@@ -12,6 +12,12 @@
 # which is admittedly extremely unlikely to the point of being impossible,
 # this software will most likely follow suit.
 
+basename() {
+	local f; f="${1##*/}"
+	[ -z "$2" ] || f="${f%$2}"
+	echo "$f"
+}
+
 SELF=$(basename $0)
 VERSION='1.2'