From: gc Date: Sat, 12 Nov 2005 16:59:28 +0000 (+0000) Subject: fix make_dest_filename to really not end up with similar dest filenames X-Git-Tag: 0.9.0~333 X-Git-Url: http://git.zarb.org/?p=booh;a=commitdiff_plain;h=6f8764e537d9a69c35e664fa9903f95a858da3ea fix make_dest_filename to really not end up with similar dest filenames --- diff --git a/lib/booh/booh-lib.rb b/lib/booh/booh-lib.rb index b660846..c361ecb 100644 --- a/lib/booh/booh-lib.rb +++ b/lib/booh/booh-lib.rb @@ -55,7 +55,7 @@ module Booh #- we remove non alphanumeric characters but need to do that #- cleverly to not end up with two similar dest filenames. we won't #- urlencode because urldecode might happen in the browser. - return orig_filename.unpack("C*").collect { |v| v.chr =~ /[a-zA-Z\-_0-9\.\/]/ ? v.chr : sprintf("%2X", v) }.to_s + return orig_filename.unpack("C*").collect { |v| v.chr =~ /[a-zA-Z\-0-9\.\/]/ ? v.chr : sprintf("_%2X", v) }.to_s end def msg(verbose_level, msg)