clever sorting

This commit is contained in:
p.kosyh 2010-06-03 08:12:40 +00:00
parent 03990ceb6f
commit b9575f897b
2 changed files with 8 additions and 1 deletions

5
debian/changelog vendored
View file

@ -1,6 +1,9 @@
instead (1.2) unstable; urgency=low
* unpack feature;
* unpack/install feature;
* browse feature (win32 and gtk);
* clever sorting;
* remove games;
-- Peter Kosyh <p.kosyh@gmail.com> Tue, 01 Jun 2010 17:40:00 +0300

View file

@ -104,6 +104,10 @@ static int cmp_game(const void *p1, const void *p2)
{
const struct game *g1 = (const struct game*)p1;
const struct game *g2 = (const struct game*)p2;
int g1_s = !!strncmp(g1->path, GAMES_PATH, strlen(GAMES_PATH));
int g2_s = !!strncmp(g2->path, GAMES_PATH, strlen(GAMES_PATH));
if (g1_s != g2_s)
return g1_s - g2_s;
return strcmp(g1->name, g2->name);
}