Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.374
diff -u -p -r1.374 theme.inc
--- includes/theme.inc	29 Aug 2007 16:56:13 -0000	1.374
+++ includes/theme.inc	29 Aug 2007 19:08:28 -0000
@@ -278,11 +278,18 @@ function _theme_process_registry(&$cache
           }
         }
 
-        if (function_exists($prefix .'_preprocess')) {
-          $info['preprocess functions'][] = $prefix .'_preprocess';
-        }
-        if (function_exists($prefix .'_preprocess_'. $hook)) {
-          $info['preprocess functions'][] = $prefix .'_preprocess_'. $hook;
+        // Let the theme engine register theme specific variable functions.
+        $prefixes[] = $prefix;
+        if ($type == 'theme_engine') {
+          $prefixes[] = $theme;
+        }
+        foreach ($prefixes as $prefix) {
+          if (function_exists($prefix .'_preprocess')) {
+            $info['preprocess functions'][] = $prefix .'_preprocess';
+          }
+          if (function_exists($prefix .'_preprocess_'. $hook)) {
+            $info['preprocess functions'][] = $prefix .'_preprocess_'. $hook;
+          }
         }
       }
       if (isset($cache[$hook]['preprocess functions']) && is_array($cache[$hook]['preprocess functions']) && empty($cache[$hook]['override preprocess functions'])) {
