Index: modules/search/search.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.module,v
retrieving revision 1.344
diff -u -p -r1.344 search.module
--- modules/search/search.module	11 Apr 2010 18:54:11 -0000	1.344
+++ modules/search/search.module	15 Apr 2010 20:16:40 -0000
@@ -246,9 +246,11 @@ function search_menu() {
   );
   drupal_static_reset('search_get_info');
   $search_hooks = search_get_info();
+  $default_module = 'node';
   foreach(variable_get('search_active_modules', array('node', 'user')) as $module) {
     if (isset($search_hooks[$module])) {
-      $items['search/' . $search_hooks[$module]['path'] . '/%menu_tail'] = array(
+      $path = 'search/' . $search_hooks[$module]['path'];
+      $items[$path] = array(
         'title' => $search_hooks[$module]['title'],
         'page callback' => 'search_view',
         'page arguments' => array($module),
@@ -256,7 +258,20 @@ function search_menu() {
         'access arguments' => array($module),
         'type' => MENU_LOCAL_TASK,
         'file' => 'search.pages.inc',
+        'tab_parent' => 'search',
+        'tab_root' => 'search',
       );
+
+      if ($module == $default_module) {
+        $items[$path]['weight'] = -10;
+      }
+
+      $items[$path . '/%menu_tail'] = $items[$path];
+      $items[$path . '/%menu_tail']['tab_root'] = 'search/' . $default_module . '/%';
+
+      if ($module == $default_module) {
+        $items[$path]['type'] = MENU_DEFAULT_LOCAL_TASK;
+      }
     }
   }
   return $items;
