diff --git a/var/mongoose/cgi-bin/browse/crop.jim b/var/mongoose/cgi-bin/browse/crop.jim index 7f8704d2..36e734af 100755 --- a/var/mongoose/cgi-bin/browse/crop.jim +++ b/var/mongoose/cgi-bin/browse/crop.jim @@ -29,6 +29,9 @@ if {[cgi_get do] eq "it"} { foreach f [glob -nocomplain "${base}.*"] { set tail [file tail $f] puts " $tail" + while {[file exists "$origdir/$tail"]} { + append tail "~" + } file rename $f "${origdir}/$tail" }