gopher: Fix for 0-length path

This is the case for urls like gopher://gophernicus.org
(without trailing /), which ended up being downloaded instead of
displayed.
This commit is contained in:
François Revol 2014-07-30 11:20:56 +02:00
parent b7e55f797d
commit 35edaf281f
1 changed files with 1 additions and 1 deletions

View File

@ -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 = "";