clever sorting
This commit is contained in:
parent
03990ceb6f
commit
b9575f897b
5
debian/changelog
vendored
5
debian/changelog
vendored
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue