Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.365
diff -u -p -r1.365 theme.inc
--- includes/theme.inc	2 Aug 2007 20:08:52 -0000	1.365
+++ includes/theme.inc	13 Aug 2007 21:52:35 -0000
@@ -260,13 +260,20 @@ function _theme_process_registry(&$cache
           }
         }
 
-        // It would be too much of a performance hit to let every module have
-        // a generic preprocess function; themes and theme engines can do that.
-        if ($type != 'module' && function_exists($prefix .'_preprocess')) {
-          $info['preprocess functions'][] = $prefix .'_preprocess';
+        // Set up this loop to let the theme engine register theme specific variable functions.
+        $prefixes[] = $prefix;
+        if ($type == 'theme_engine') {
+          $prefixes[] = $theme;
         }
-        if (function_exists($prefix .'_preprocess_'. $hook)) {
-          $info['preprocess functions'][] = $prefix .'_preprocess_'. $hook;
+        foreach ($prefixes as $prefix) {
+          // It would be too much of a performance hit to let every module have
+          // a generic preprocess function; themes and theme engines can do that.
+          if ($type != 'module' && 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'])) {
