]> git.mxchange.org Git - simgear.git/commitdiff
Fix repository test.
authorJames Turner <zakalawe@mac.com>
Fri, 1 Jul 2016 08:02:52 +0000 (09:02 +0100)
committerRoland Haeder <roland@mxchange.org>
Sat, 13 Aug 2016 08:21:16 +0000 (10:21 +0200)
simgear/io/HTTPRepository.cxx
simgear/io/test_repository.cxx

index 42418b60e14051567dd53cdb07db874d30fd0e8e..6a63142344e46b8cd8a1609c2f68f9a38dd9cacd 100644 (file)
@@ -405,7 +405,8 @@ public:
 
     HTTPDirectory* childDirectory(const std::string& name)
     {
-        return _repository->getOrCreateDirectory(relativePath() + "/" + name);
+        std::string childPath = relativePath().empty() ? name : relativePath() + "/" + name;
+        return _repository->getOrCreateDirectory(childPath);
     }
 
     void removeOrphans(const string_list& orphans)
index 190d7ecdcf598a7f634b01e924086f62a69116fc..843c9680bfe0916c1357a7c9aeec3f0eba1340cc 100644 (file)
@@ -256,6 +256,10 @@ public:
                 repoPath = repoPath.substr(0, suffix);
             }
 
+            if (repoPath.find("/") == 0) { // trim leading /
+                repoPath = repoPath.substr(1);
+            }
+
             TestRepoEntry* entry = global_repo->findEntry(repoPath);
             if (!entry) {
                 sendErrorResponse(404, false, "unknown repo path:" + repoPath);