We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d4e24a commit 7689f30Copy full SHA for 7689f30
lib/net/sftp/operations/dir.rb
@@ -57,7 +57,7 @@ def entries(path)
57
# it should be able to handle modest numbers of files in each directory.
58
def glob(path, pattern, flags=0)
59
flags |= ::File::FNM_PATHNAME
60
- path = path.chop if path[-1,1] == "/"
+ path = path.chop if path.end_with?('/') && path != '/'
61
62
results = [] unless block_given?
63
queue = entries(path).reject { |e| e.name == "." || e.name == ".." }
@@ -90,4 +90,4 @@ def [](path, pattern)
90
end
91
92
93
-end; end; end
+end; end; end
0 commit comments