--- menu.inc	2010-02-01 19:00:49.000000000 +0100
+++ menu.inc.patched	2010-04-18 11:09:36.625000000 +0200
@@ -1560,19 +1560,12 @@ function menu_set_active_trail($new_trai
     list($key, $curr) = each($tree);
 
     while ($curr) {
-      // Terminate the loop when we find the current path in the active trail.
-      if ($curr['link']['href'] == $item['href']) {
+      // Add the link if it's in the active trail, then move to the link below.
+      if ($curr['link']['in_active_trail']) {
         $trail[] = $curr['link'];
-        $curr = FALSE;
-      }
-      else {
-        // Add the link if it's in the active trail, then move to the link below.
-        if ($curr['link']['in_active_trail']) {
-          $trail[] = $curr['link'];
-          $tree = $curr['below'] ? $curr['below'] : array();
-        }
-        list($key, $curr) = each($tree);
+        $tree = $curr['below'] ? $curr['below'] : array();
       }
+      list($key, $curr) = each($tree);
     }
     // Make sure the current page is in the trail (needed for the page title),
     // but exclude tabs and the front page.
