From d4015c454b7b52a82c38ba8a14fd4d9d452ee80a Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sat, 14 Nov 2015 14:56:54 -0800 Subject: [PATCH] ls: if the top-level URL path has a separator return quickly --- url.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/url.go b/url.go index fdf04d49..7d84fcad 100644 --- a/url.go +++ b/url.go @@ -107,6 +107,12 @@ func url2DirContent(urlStr string) (content *client.Content, err *probe.Error) { if err != nil { return nil, err.Trace(urlStr) } + if clnt.GetURL().Path == string(clnt.GetURL().Separator) { + content := new(client.Content) + content.URL = clnt.GetURL() + content.Type = os.ModeDir + return content, nil + } isRecursive := false isIncomplete := false for entry := range clnt.List(isRecursive, isIncomplete) {