diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/tree.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/tree.c b/apps/tree.c index 5f54784515..d15547d048 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -108,10 +108,15 @@ extern unsigned char bitmap_icons_6x8[LastIcon][6]; | |||
108 | #define TREE_ATTR_M3U 0x80 /* unused by FAT attributes */ | 108 | #define TREE_ATTR_M3U 0x80 /* unused by FAT attributes */ |
109 | #define TREE_ATTR_MP3 0x40 /* unused by FAT attributes */ | 109 | #define TREE_ATTR_MP3 0x40 /* unused by FAT attributes */ |
110 | 110 | ||
111 | static int compare(const void* e1, const void* e2) | 111 | static int compare(const void* p1, const void* p2) |
112 | { | 112 | { |
113 | return strncmp((*(struct entry**)e1)->name, (*(struct entry**)e2)->name, | 113 | struct entry* e1 = *(struct entry**)p1; |
114 | TREE_MAX_FILENAMELEN); | 114 | struct entry* e2 = *(struct entry**)p2; |
115 | |||
116 | if (( e1->attr & ATTR_DIRECTORY ) == ( e2->attr & ATTR_DIRECTORY )) | ||
117 | return strncasecmp(e1->name, e2->name, TREE_MAX_FILENAMELEN); | ||
118 | else | ||
119 | return ( e2->attr & ATTR_DIRECTORY ) - ( e1->attr & ATTR_DIRECTORY ); | ||
115 | } | 120 | } |
116 | 121 | ||
117 | static int showdir(char *path, int start) | 122 | static int showdir(char *path, int start) |