Index: pathauto.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/pathauto/pathauto.inc,v
retrieving revision 1.51
diff -u -r1.51 pathauto.inc
--- pathauto.inc	21 Mar 2009 00:24:28 -0000	1.51
+++ pathauto.inc	21 Jul 2009 14:24:51 -0000
@@ -250,6 +250,11 @@
     $output = preg_replace("/$seppattern+/", "$separator", $output);
   }
 
+  // Optionally convert to lower case
+  if (variable_get('pathauto_case', PATHAUTO_CASE_LOWER)) {
+    $output = drupal_strtolower($output);
+  }
+
   // Enforce the maximum component length
   $maxlength = min(variable_get('pathauto_max_component_length', 100), 128);
   $output = _pathauto_truncate_chars($output, $maxlength, $separator);
@@ -328,14 +333,9 @@
     $old_alias = $update_data['old_alias'];
   }
 
-  // Replace the placeholders with the values provided by the module,
-  // and optionally lower-case the result
+  // Replace the placeholders with the values provided by the module
   $alias = str_replace($placeholders['tokens'], $placeholders['values'], $pattern);
 
-  if (variable_get('pathauto_case', PATHAUTO_CASE_LOWER)) {
-    $alias = drupal_strtolower($alias);
-  }
-
   // Two or more slashes should be collapsed into one
   $alias = preg_replace('/\/+/', '/', $alias);

