Skip to content

Commit

Permalink
gopher: Fix for 0-length path
Browse files Browse the repository at this point in the history
This is the case for urls like gopher://gophernicus.org
(without trailing /), which ended up being downloaded instead of
displayed.
  • Loading branch information
mmuman committed Jul 30, 2014
1 parent b7e55f7 commit 35edaf2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/kits/network/libnetapi/GopherRequest.cpp
Expand Up @@ -193,7 +193,7 @@ BGopherRequest::BGopherRequest(const BUrl& url, BUrlProtocolListener* listener,
// the first part of the path is actually the document type

fPath = Url().Path();
if (!Url().HasPath() || (fPath.Length() == 1 && fPath[0] == '/')) {
if (!Url().HasPath() || fPath.Length() == 0 || fPath == "/") {
// default entry
fItemType = GOPHER_TYPE_DIRECTORY;
fPath = "";
Expand Down

0 comments on commit 35edaf2

Please sign in to comment.