Better to inicializa prefix fully in the constructor body.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 23 Oct 2013 17:14:46 +0000 (19:14 +0200)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 10 Feb 2014 14:08:02 +0000 (15:08 +0100)
src/VfsNs.cpp

index fd25f64..efdc8a2 100644 (file)
@@ -34,7 +34,7 @@ static gid_t getGid(const SecurityContext* ctx) {
 
 
 VfsCatalog::VfsCatalog(const std::string& host, const std::string& prefix, const std::string &allow, const std::string &deny, const std::string allowWrite, const std::string denyWrite) throw (DmException): Catalog(),
-        hostName_(host), prefix_(prefix)
+        hostName_(host)
 {
   this->allowRegex = vfsCompileRegex("Allow", allow);
   this->denyRegex = vfsCompileRegex("Deny", deny);
@@ -42,6 +42,7 @@ VfsCatalog::VfsCatalog(const std::string& host, const std::string& prefix, const
   this->denyWriteRegex = vfsCompileRegex("DenyWrite", denyWrite);
 
   if (prefix.empty()) this->prefix_ = "";
+  else this->prefix_ = prefix;
 }