diff -r d9ca12e42fc6 cmd/wmiibar.c --- a/cmd/wmiibar.c Fri Jan 27 21:08:12 2006 +++ b/cmd/wmiibar.c Sat Jan 28 13:28:59 2006 @@ -195,12 +195,6 @@ init_draw_label(path, &i->d); } -static int -comp_str(const void *s1, const void *s2) -{ - return strcmp(*(char **) s1, *(char **) s2); -} - static void draw() { @@ -260,9 +254,9 @@ static void draw_bar(void *obj, char *arg) { - File *label = 0; - unsigned int i = 0, n = 0; + File *f, *label = 0; Item *item; + size_t i; char buf[512]; if (!displayed) @@ -288,28 +282,13 @@ d.border = blitz_loadcolor(dpy, screen_num, files[B_BORDER_COLOR]->content); blitz_drawlabelnoborder(dpy, &d); } else { - File *f; - char **paths = 0; - /* - * take order into account, directory names are used in - * alphabetical order - */ - n = 0; - for (f = label; f; f = f->next) - n++; - paths = emalloc(sizeof(char *) * n); - i = 0; - for (f = label; f; f = f->next) - paths[i++] = f->name; - qsort(paths, n, sizeof(char *), comp_str); - for (i = 0; i < n; i++) { - snprintf(buf, sizeof(buf), "/%s", paths[i]); + for (f = label; f; f = f->next) { + snprintf(buf, sizeof(buf), "/%s", f->name); item = emalloc(sizeof(Item)); items = (Item **) attach_item_end((void **) items, item, sizeof(Item *)); init_item(buf, item); } draw(); - free(paths); } }