Index: includes/module.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/module.inc,v
retrieving revision 1.180
diff -u -p -r1.180 module.inc
--- includes/module.inc	28 Jan 2010 13:56:24 -0000	1.180
+++ includes/module.inc	11 Feb 2010 17:52:45 -0000
@@ -619,8 +619,17 @@ function module_hook_info() {
         $function = $module . '_hook_info';
         if (function_exists($function)) {
           $result = $function();
-          if (isset($result) && is_array($result)) {
-            $hook_info = array_merge_recursive($hook_info, $result);
+          if (isset($result)) {
+            if (is_array($result)) {
+              if (!empty($result)) {
+                if (empty($return)) {
+                  $hook_info = $result;
+                }
+                else {
+                  $hook_info = array_merge_recursive($hook_info, $result);
+                }
+              }
+            }
           }
         }
       }
@@ -698,11 +707,20 @@ function module_invoke_all() {
     $function = $module . '_' . $hook;
     if (function_exists($function)) {
       $result = call_user_func_array($function, $args);
-      if (isset($result) && is_array($result)) {
-        $return = array_merge_recursive($return, $result);
-      }
-      elseif (isset($result)) {
-        $return[] = $result;
+      if (isset($result)) {
+        if (is_array($result)) {
+          if (!empty($result)) {
+            if (empty($return)) {
+              $return = $result;
+            }
+            else {
+              $return = array_merge_recursive($return, $result);
+            }
+          }
+        }
+        else {
+          $return[] = $result;
+        }
       }
     }
   }
