// were massive memory leaks
TexReferences.DeleteContents(true);
TexReferences.Put(
- labelStr.c_str(),
+ labelStr,
new TexRef(
labelStr.c_str(),
fileStr.c_str(),
}
// Ignore end-of-line comments
- if (line[0] == _T('%') || line[0] == _T(';') || line[0] == _T('#'))
+ if ( !line.empty() && (line[0] == _T('%') || line[0] == _T(';') || line[0] == _T('#')))
{
- line = wxEmptyString;
+ line.clear();
}
}
val << line[0];
line = line.substr(1);
}
- if (line[0] == '"')
+ if (!line.empty() && line[0] == '"')
line = line.substr(1);
return val;
macro->macroBody = copystring(macroBody.c_str());
BibEatWhiteSpace(line);
- CustomMacroList.Append(macroName.c_str(), macro);
+ CustomMacroList.Append(macroName, macro);
AddMacroDef(ltCUSTOM_MACRO, macroName.c_str(), noArgs);
}