Index: form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.265.2.34
diff -u -r1.265.2.34 form.inc
--- form.inc	6 Aug 2010 11:02:49 -0000	1.265.2.34
+++ form.inc	4 Nov 2010 14:47:50 -0000
@@ -767,8 +767,8 @@
 
   foreach ($handlers as $function) {
     if (function_exists($function))  {
-      // Check to see if a previous _submit handler has set a batch, but 
-      // make sure we do not react to a batch that is already being processed 
+      // Check to see if a previous _submit handler has set a batch, but
+      // make sure we do not react to a batch that is already being processed
       // (for instance if a batch operation performs a drupal_execute()).
       if ($type == 'submit' && ($batch =& batch_get()) && !isset($batch['current_set'])) {
         // Some previous _submit handler has set a batch. We store the call
@@ -934,8 +934,8 @@
   if (isset($form['#after_build']) && !isset($form['#after_build_done'])) {
     foreach ($form['#after_build'] as $function) {
       $form = $function($form, $form_state);
-      $form['#after_build_done'] = TRUE;
     }
+    $form['#after_build_done'] = TRUE;
   }
 
   // Now that we've processed everything, we can go back to handle the funky

