From: Tollef Fog Heen Date: Sun, 20 Jul 2008 17:18:56 +0000 (+0200) Subject: Rename inv_alphasort to acmp and make it not invert the return code of strcoll; this... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de58f7f8a3dc25380dc4619171e56e1b80153987;p=dpkg Rename inv_alphasort to acmp and make it not invert the return code of strcoll; this makes us sort in ascending order --- diff --git a/src/filters.c b/src/filters.c index b09ff557..de72aef0 100644 --- a/src/filters.c +++ b/src/filters.c @@ -90,8 +90,8 @@ loadfilter(const char *fn) ohshite(_("error closing configuration file '%.255s'"), fn); } -static int inv_alphasort(const void *a, const void *b) { - return -1 * strcoll((char*)a, (char*) b); +static int acmp(const void *a, const void *b) { + return strcoll((char*)a, (char*) b); } void @@ -129,7 +129,7 @@ loadfilters(void) } free(file); } - qsort(names, i, sizeof(char *), inv_alphasort); + qsort(names, i, sizeof(char *), acmp); while (i > 0) { loadfilter(names[--i]); free(names[i]);