Fixed a crash with empty path names in theme box definitions.

This commit is contained in:
Aloshi 2013-05-16 13:27:19 -05:00
parent 0f6338045a
commit ec48c5d3a4

View file

@ -332,6 +332,9 @@ Gui* GuiTheme::createElement(pugi::xml_node data, Gui* parent)
//expands a file path (./ becomes the directory of this theme file, ~/ becomes $HOME/)
std::string GuiTheme::expandPath(std::string path)
{
if(path.length() == 0)
return "";
if(path[0] == '~')
path = getHomePath() + path.substr(1, path.length() - 1);
else if(path[0] == '.')