fixing dir normalization under windows

This commit is contained in:
jondot
2010-12-31 19:21:54 +02:00
parent 491eee7ebd
commit 096edd20da
+2 -1
View File
@@ -60,6 +60,7 @@ module Gollum
# normalize_dir("foo") # => "/foo"
# normalize_dir("/foo/") # => "/foo"
# normalize_dir("/") # => ""
# normalize_dir("c:/") # => ""
#
# dir - String directory name.
#
@@ -68,7 +69,7 @@ module Gollum
def self.normalize_dir(dir)
if dir
dir = ::File.expand_path(dir, '/')
dir = '' if dir == '/'
dir = '' if (dir == '/' || dir =~ /^.:\/$/)
end
dir
end