Browse Source

Turns out alphasort was totally broken. This fixed one works.
-Erik

Eric Andersen 23 years ago
parent
commit
6c0899094d
1 changed files with 3 additions and 4 deletions
  1. 3 4
      libc/misc/dirent/alphasort.c

+ 3 - 4
libc/misc/dirent/alphasort.c

@@ -1,10 +1,9 @@
 #include <string.h>
 #include "dirstream.h"
 
-int alphasort(const __ptr_t __e1, const __ptr_t __e2)
+int alphasort(const void * a, const void * b)
 {
-    const struct dirent *a = __e1;
-    const struct dirent *b = __e2;
-    return (strcmp(a->d_name, b->d_name));
+    return strcmp ((*(const struct dirent **) a)->d_name,
+	    (*(const struct dirent **) b)->d_name);
 }