Changes in uspace/app/bdsh/cmds/modules/ls/ls.c [8d2dd7f2:f2460a50] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/ls/ls.c
r8d2dd7f2 rf2460a50 39 39 #include <vfs/vfs.h> 40 40 #include <str.h> 41 #include <sort.h>42 41 43 42 #include "ls.h" … … 62 61 static unsigned int ls_start(ls_job_t *); 63 62 static void ls_print(struct dir_elem_t *); 64 static int ls_cmp( void *, void *,void *);63 static int ls_cmp(const void *, const void *); 65 64 static signed int ls_scan_dir(const char *, DIR *, struct dir_elem_t **); 66 65 static unsigned int ls_recursive(const char *, DIR *); … … 104 103 * @param a Pointer to the structure of the first element. 105 104 * @param b Pointer to the structure of the second element. 106 * @param arg Pointer for an other and optionnal argument.107 105 * 108 106 * @return -1 if a < b, 1 otherwise. 109 107 */ 110 static int ls_cmp( void *a, void *b, void *arg)111 { 112 struct dir_elem_t *da = a;113 struct dir_elem_t *db = b;108 static int ls_cmp(const void *a, const void *b) 109 { 110 struct dir_elem_t const *da = a; 111 struct dir_elem_t const *db = b; 114 112 115 113 if ((da->s.is_directory && db->s.is_file) || … … 191 189 } 192 190 193 if (ls.sort) { 194 if (!qsort(&tosort[0], nbdirs, sizeof(struct dir_elem_t), 195 ls_cmp, NULL)) { 196 printf("Sorting error.\n"); 197 } 198 } 191 if (ls.sort) 192 qsort(&tosort[0], nbdirs, sizeof(struct dir_elem_t), ls_cmp); 199 193 200 194 for (i = 0; i < nbdirs; i++)
Note:
See TracChangeset
for help on using the changeset viewer.