]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/store/files/file_store.cpp
Fixed parsing parameters with empty values.
[stg.git] / projects / stargazer / plugins / store / files / file_store.cpp
index a8b3990ffed700132ee3f5f0670894ba0cb04736..2a7eb6c131719cea07ff1b1a477026b979b15e7b 100644 (file)
@@ -80,11 +80,6 @@ return fsc.GetPlugin();
 //-----------------------------------------------------------------------------
 FILES_STORE_SETTINGS::FILES_STORE_SETTINGS()
     : settings(NULL),
-      errorStr(),
-      workDir(),
-      usersDir(),
-      adminsDir(),
-      tariffsDir(),
       statMode(0),
       statUID(0),
       statGID(0),
@@ -105,7 +100,7 @@ PARAM_VALUE pv;
 pv.param = owner;
 std::vector<PARAM_VALUE>::const_iterator pvi;
 pvi = find(moduleParams.begin(), moduleParams.end(), pv);
-if (pvi == moduleParams.end())
+if (pvi == moduleParams.end() || pvi->value.empty())
     {
     errorStr = "Parameter \'" + owner + "\' not found.";
     printfd(__FILE__, "%s\n", errorStr.c_str());
@@ -126,7 +121,7 @@ PARAM_VALUE pv;
 pv.param = group;
 std::vector<PARAM_VALUE>::const_iterator pvi;
 pvi = find(moduleParams.begin(), moduleParams.end(), pv);
-if (pvi == moduleParams.end())
+if (pvi == moduleParams.end() || pvi->value.empty())
     {
     errorStr = "Parameter \'" + group + "\' not found.";
     printfd(__FILE__, "%s\n", errorStr.c_str());
@@ -164,7 +159,7 @@ PARAM_VALUE pv;
 pv.param = modeStr;
 std::vector<PARAM_VALUE>::const_iterator pvi;
 pvi = find(moduleParams.begin(), moduleParams.end(), pv);
-if (pvi == moduleParams.end())
+if (pvi == moduleParams.end() || pvi->value.empty())
     {
     errorStr = "Parameter \'" + modeStr + "\' not found.";
     printfd(__FILE__, "%s\n", errorStr.c_str());
@@ -206,7 +201,7 @@ std::vector<PARAM_VALUE>::const_iterator pvi;
 PARAM_VALUE pv;
 pv.param = "RemoveBak";
 pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
-if (pvi == s.moduleParams.end())
+if (pvi == s.moduleParams.end() || pvi->value.empty())
     {
     removeBak = true;
     }
@@ -221,7 +216,7 @@ else
 
 pv.param = "ReadBak";
 pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
-if (pvi == s.moduleParams.end())
+if (pvi == s.moduleParams.end() || pvi->value.empty())
     {
     readBak = false;
     }
@@ -236,7 +231,7 @@ else
 
 pv.param = "WorkDir";
 pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
-if (pvi == s.moduleParams.end())
+if (pvi == s.moduleParams.end() || pvi->value.empty())
     {
     errorStr = "Parameter \'WorkDir\' not found.";
     printfd(__FILE__, "Parameter 'WorkDir' not found\n");