]> granicus.if.org Git - apache/commitdiff
Solve a bug I introduced this weekend, we want to compare core_*->r
authorWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 27 Aug 2001 16:35:43 +0000 (16:35 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 27 Aug 2001 16:35:43 +0000 (16:35 +0000)
  as a boolean, not by value.

  Reported by: Barrie Slaymaker <barries@slaysys.com>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90729 13f79535-47bb-0310-9956-ffa450edef68

server/core.c

index ed918c4a112e90b6e8c69169e6db0ee47900ed73..cd5d09ddd12c8d6413495e16cd6ebd962dd41c82 100644 (file)
@@ -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;
 }