Index: modules/locale/locale.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.install,v
retrieving revision 1.67
diff -u -p -r1.67 locale.install
--- modules/locale/locale.install	25 Sep 2010 18:10:53 -0000	1.67
+++ modules/locale/locale.install	4 Oct 2010 15:56:11 -0000
@@ -46,6 +46,7 @@ function locale_update_7000() {
  */
 function locale_update_7001() {
   require_once DRUPAL_ROOT . '/includes/language.inc';
+  require_once DRUPAL_ROOT . '/includes/locale.inc';
   require_once DRUPAL_ROOT . '/modules/locale/locale.module';
 
   switch (variable_get('language_negotiation', 0)) {
@@ -62,9 +63,12 @@ function locale_update_7001() {
       // Drupal 7 path prefixes are always shown if not empty. Hence we need to
       // ensure that the default language has an empty prefix to avoid breaking
       // the site URLs with a prefix that previously was missing.
+      $default = language_default();
+      $default->prefix = '';
+      variable_set('language_default', $default);
       db_update('languages')
-        ->fields(array('prefix' => ''))
-        ->condition('language', language_default()->language)
+        ->fields(array('prefix' => $default->prefix))
+        ->condition('language', $default->language)
         ->execute();
       break;
 
