Commit 24cad403 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner Committed by Naoki Kambe

[2123] Scope of variables

parent a51a74fa
......@@ -476,9 +476,9 @@ ModuleSpec::validateSpecList(ConstElementPtr spec, ConstElementPtr data,
typedef std::pair<std::string, ConstElementPtr> maptype;
BOOST_FOREACH(maptype m, data->mapValue()) {
bool found = false;
// Ignore 'version' as a config element
if (m.first.compare("version") != 0) {
bool found = false;
BOOST_FOREACH(ConstElementPtr cur_spec_el, spec->listValue()) {
if (cur_spec_el->get("item_name")->stringValue().compare(m.first) == 0) {
found = true;
......
......@@ -34,9 +34,9 @@ Filename::split(const string& full_name, string& directory,
string& name, string& extension) const
{
directory = name = extension = "";
bool dir_present = false;
if (!full_name.empty()) {
bool dir_present = false;
// Find the directory.
size_t last_slash = full_name.find_last_of('/');
if (last_slash != string::npos) {
......
......@@ -39,10 +39,9 @@ normalizeSlash(std::string& name) {
string
trim(const string& instring) {
static const char* blanks = " \t\n";
string retstring = "";
if (!instring.empty()) {
static const char* blanks = " \t\n";
// Search for first non-blank character in the string
size_t first = instring.find_first_not_of(blanks);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment