X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Fqueue.c;h=f9468119780b603b91382a4461238bc2169fc77a;hb=fd622879c0d6f6d4099a760b1e304874df778f37;hp=8b0494b269a7593c6f97c74446665fe3890e26b0;hpb=cab0c27721a3c1f3a146e44bcc6462eefb9eb9e7;p=exim.git diff --git a/src/src/queue.c b/src/src/queue.c index 8b0494b26..f94681197 100644 --- a/src/src/queue.c +++ b/src/src/queue.c @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2015 */ +/* Copyright (c) University of Cambridge 1995 - 2017 */ /* See the file NOTICE for conditions of use and distribution. */ /* Functions that operate on the input queue. */ @@ -80,7 +80,11 @@ queue_filename *first = NULL; queue_filename **append = &first; while (a && b) - if (Ustrcmp(a->text, b->text) < 0) + { + int d; + if ((d = Ustrncmp(a->text, b->text, 6)) == 0) + d = Ustrcmp(a->text + 14, b->text + 14); + if (d < 0) { *append = a; append= &a->next; @@ -92,6 +96,7 @@ while (a && b) append= &b->next; b = b->next; } + } *append = a ? a : b; return first; @@ -278,7 +283,7 @@ for (; i <= *subcount; i++) if (root[j]) { next = merge_queue_lists(next, root[j]); - root[j] = (j == LOG2_MAXNODES - 1)? next : NULL; + root[j] = j == LOG2_MAXNODES - 1 ? next : NULL; } else { @@ -450,8 +455,8 @@ subsequent iterations. When the first argument of queue_get_spool_list() is -1 (for queue_run_in_ order), it scans all directories and makes a single message list. */ -for (i = (queue_run_in_order? -1 : 0); - i <= (queue_run_in_order? -1 : subcount); +for (i = queue_run_in_order ? -1 : 0; + i <= (queue_run_in_order ? -1 : subcount); i++) { queue_filename *f;