From: William A. Rowe Jr Date: Mon, 27 Aug 2001 16:35:43 +0000 (+0000) Subject: Solve a bug I introduced this weekend, we want to compare core_*->r X-Git-Tag: 2.0.25~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15cdc86233953c01f883b04d58c2bdcff49e5a1f;p=apache Solve a bug I introduced this weekend, we want to compare core_*->r as a boolean, not by value. Reported by: Barrie Slaymaker git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90729 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/core.c b/server/core.c index ed918c4a11..cd5d09ddd1 100644 --- a/server/core.c +++ b/server/core.c @@ -395,12 +395,16 @@ static int reorder_sorter(const void *va, const void *vb) core_a = ap_get_module_config(a->elt, &core_module); core_b = ap_get_module_config(b->elt, &core_module); - if (core_a->r < core_b->r) { + /* a regex always sorts after a non-regex + */ + if (!core_a->r && core_b->r) { return -1; } - else if (core_a->r > core_b->r) { + else if (core_a->r && !core_b->r) { return 1; } + /* we always sort next by the number of components + */ if (core_a->d_components < core_b->d_components) { return -1; } @@ -408,7 +412,7 @@ static int reorder_sorter(const void *va, const void *vb) return 1; } /* They have the same number of components, we now have to compare - * the minor key to maintain the original order. + * the minor key to maintain the original order (from the config.) */ return a->orig_index - b->orig_index; }