From 35edaf281fddea9e0eca4b93e3aa9a75eb967dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Wed, 30 Jul 2014 11:20:56 +0200 Subject: [PATCH] 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. --- src/kits/network/libnetapi/GopherRequest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kits/network/libnetapi/GopherRequest.cpp b/src/kits/network/libnetapi/GopherRequest.cpp index da1342ae0c..951a9ccd88 100644 --- a/src/kits/network/libnetapi/GopherRequest.cpp +++ b/src/kits/network/libnetapi/GopherRequest.cpp @@ -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 = "";