diff options
author | Rob Landley <rob@landley.net> | 2015-04-19 21:50:51 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2015-04-19 21:50:51 -0500 |
commit | 5b493dc48db03c7e27c8ce002fe216bcd778fe92 (patch) | |
tree | b7bb7af18aff4d01bab1b635384d455add1aeb33 /lib/lib.c | |
parent | 3cf9b08cc9ebeddc449638608f7a28c4c4ba20f9 (diff) | |
download | toybox-5b493dc48db03c7e27c8ce002fe216bcd778fe92.tar.gz |
Cleanup getprop, add qstrcmp() to lib for qsort (because posix-2008 broke
alphasort), add compile-time probe for config symbol TOYBOX_ON_ANDROID.
Diffstat (limited to 'lib/lib.c')
-rw-r--r-- | lib/lib.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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); +} |