summaryrefslogtreecommitdiffstats
path: root/lib/ftools.rb
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-02 10:36:34 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-02 10:36:34 +0000
commit361be96e52a2982e5ab1c061efa73fd152446cfd (patch)
treee89854471aba5e2c90da990b9779e6bfeacc9863 /lib/ftools.rb
parent1baa36bc201ed2c715891df2858f3c14790953e9 (diff)
downloadruby-361be96e52a2982e5ab1c061efa73fd152446cfd.tar.gz
ruby-361be96e52a2982e5ab1c061efa73fd152446cfd.tar.xz
ruby-361be96e52a2982e5ab1c061efa73fd152446cfd.zip
* lib/ftools.rb (catname): allow trailing '/' for the destination.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/ftools.rb')
-rw-r--r--lib/ftools.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/ftools.rb b/lib/ftools.rb
index 5e6203b1a..4047a595e 100644
--- a/lib/ftools.rb
+++ b/lib/ftools.rb
@@ -4,12 +4,7 @@ class << File
def catname from, to
if FileTest.directory? to
- to +
- if to =~ /\\/
- if to[-1,1] != '\\' then '\\' end + basename(from)
- else
- if to[-1,1] != '/' then '/' end + basename(from)
- end
+ File.join to.sub(%r([/\\]$), ''), basename(from)
else
to
end