Index: path.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.module,v
retrieving revision 1.149
diff -u -p -r1.149 path.module
--- path.module	12 Oct 2008 04:30:06 -0000	1.149
+++ path.module	27 Oct 2008 16:01:07 -0000
@@ -98,7 +98,11 @@ function path_set_alias($path = NULL, $a
     if ($alias == drupal_get_path_alias($path, $language)) {
       // There is already such an alias, neutral or in this language.
       // Update the alias based on alias; setting the language if not yet done.
-      db_query("UPDATE {url_alias} SET src = '%s', dst = '%s', language = '%s' WHERE dst = '%s'", $path, $alias, $language, $alias);
+      if ($language) {
+        db_query("UPDATE {url_alias} SET src = '%s', dst = '%s', language = '%s' WHERE dst = '%s' and language = '$language' ", $path, $alias, $language, $alias, $language);
+      } else {
+        db_query("UPDATE {url_alias} SET src = '%s', dst = '%s', language = '%s' WHERE dst = '%s'", $path, $alias, $language, $alias);
+      }
     }
     else {
       // A new alias. Add it to the database.
