From f778213aea996f424e7a225b63a45dfecb82e47b Mon Sep 17 00:00:00 2001 From: Darren Oakley Date: Tue, 29 May 2012 16:32:42 +0100 Subject: [PATCH] Bugfix: Using the Pathname helper returned '' unless there was a file to target. --- lib/gollum/frontend/app.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/gollum/frontend/app.rb b/lib/gollum/frontend/app.rb index 5756b4917..c4df0ab33 100644 --- a/lib/gollum/frontend/app.rb +++ b/lib/gollum/frontend/app.rb @@ -62,7 +62,9 @@ def current_user # Extract the path string that Gollum::Wiki expects def extract_path(file_path) - pn = Pathname.new(file_path.dup).dirname.to_s.sub(/^\//,'') + path = file_path.dup + path << 'foo.tmp' if file_path =~ /\/$/ + pn = Pathname.new(path).dirname.to_s.sub(/^\//,'') pn unless ['','.','/'].include?(pn) end