Reinserted patch 1.279 (was lost in move to filetree.c)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5577 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2005-01-17 12:29:27 +00:00
parent 5df90b4875
commit b2d84b1607

View file

@ -135,6 +135,14 @@ static int compare(const void* p1, const void* p2)
if (e1->attr & ATTR_DIRECTORY && e2->attr & ATTR_DIRECTORY)
{ /* two directories */
criteria = global_settings.sort_dir;
if (e1->attr & ATTR_VOLUME || e2->attr & ATTR_VOLUME)
{ /* a volume identifier is involved */
if (e1->attr & ATTR_VOLUME && e2->attr & ATTR_VOLUME)
criteria = 0; /* two volumes: sort alphabetically */
else /* only one is a volume: volume first */
return (e2->attr & ATTR_VOLUME) - (e1->attr & ATTR_VOLUME);
}
}
else if (!(e1->attr & ATTR_DIRECTORY) && !(e2->attr & ATTR_DIRECTORY))
{ /* two files */