From d902111a57dfcf3c9b017b0ebd1b49f19142168c Mon Sep 17 00:00:00 2001 From: eban Date: Tue, 2 Oct 2001 10:36:34 +0000 Subject: [PATCH] * lib/ftools.rb (catname): allow trailing '/' for the destination. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ lib/ftools.rb | 7 +------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9055093b28..bbc536d74d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Oct 2 19:12:47 2001 WATANABE Hirofumi + + * lib/ftools.rb (catname): allow trailing '/' for the destination. + Tue Oct 2 08:04:52 2001 Nobuyoshi Nakada * marshal.c (r_object): TYPE_UCLASS check should be inversed. diff --git a/lib/ftools.rb b/lib/ftools.rb index 5e6203b1a3..4047a595eb 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