Skip to content

Commit

Permalink
Fixed|VersionInfo: Parsing version with just two components
Browse files Browse the repository at this point in the history
dengine.net now provides a two-component version if the revision is 0.
Fixed an out-of-bounds indexing in the parser.
  • Loading branch information
skyjake committed Mar 28, 2013
1 parent 86d1c59 commit d334bb3
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions doomsday/client/src/updater/versioninfo.h
Expand Up @@ -49,16 +49,20 @@ struct VersionInfo
QStringList parts = version.split('.');
major = parts[0].toInt();
minor = parts[1].toInt();
if(parts[2].contains('-'))
revision = 0;
patch = 0;
if(parts.size() > 2)
{
QStringList rev = parts[2].split('-');
revision = rev[0].toInt();
patch = rev[1].toInt();
}
else
{
revision = parts[2].toInt();
patch = 0;
if(parts[2].contains('-'))
{
QStringList rev = parts[2].split('-');
revision = rev[0].toInt();
patch = rev[1].toInt();
}
else
{
revision = parts[2].toInt();
}
}
}

Expand Down

0 comments on commit d334bb3

Please sign in to comment.