From: Arvin Schnell Date: Wed, 1 Jun 2011 17:00:12 +0000 (+0200) Subject: - fixed SysconfigFile::getValue for empty list X-Git-Tag: v0.1.3~372 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=afc24f7eb403a565154c09524bce5aaf0dbff9ae;p=thirdparty%2Fsnapper.git - fixed SysconfigFile::getValue for empty list --- diff --git a/snapper/AsciiFile.cc b/snapper/AsciiFile.cc index 10f2c00b..b5795eda 100644 --- a/snapper/AsciiFile.cc +++ b/snapper/AsciiFile.cc @@ -190,10 +190,14 @@ AsciiFile::save() SysconfigFile::getValue(const string& key, vector& values) const { string tmp; - if (!getValue("SNAPPER_CONFIGS", tmp)) + if (!getValue(key, tmp)) return false; - boost::split(values, tmp, boost::is_any_of(" \t")); + values.clear(); + + if (!tmp.empty()) + boost::split(values, tmp, boost::is_any_of(" \t"), boost::token_compress_on); + return true; }