Default to filename for name if name isn't set

This commit is contained in:
simon.kagstrom 2010-01-30 18:52:14 +00:00
parent 94c53ceb22
commit 6ff06c0d1f

View File

@ -28,7 +28,10 @@ GameInfo::GameInfo(const char *filename,
SDL_Surface *image) SDL_Surface *image)
{ {
this->filename = xstrdup(filename); this->filename = xstrdup(filename);
this->name = xstrdup(name); if (strcmp(name, " ") == 0)
this->name = xstrdup(filename);
else
this->name = xstrdup(name);
this->author = xstrdup(author); this->author = xstrdup(author);
this->screenshot = image; this->screenshot = image;
} }