aboutsummaryrefslogtreecommitdiff
path: root/lib/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lib.c')
-rw-r--r--lib/lib.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/lib.c b/lib/lib.c
index 99d2ea60..1a60a7ff 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -887,3 +887,11 @@ int human_readable(char *buf, unsigned long long num)
return end;
}
+
+// The qsort man page says you can use alphasort, the posix committee
+// disagreed, and doubled down: http://austingroupbugs.net/view.php?id=142
+// So just do our own. (The const is entirely to humor the stupid compiler.)
+int qstrcmp(const void *a, const void *b)
+{
+ return strcmp(*(char **)a, *(char **)b);
+}