Index: includes/path.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/path.inc,v
retrieving revision 1.55
diff -u -p -r1.55 path.inc
--- includes/path.inc	7 Jan 2010 04:54:18 -0000	1.55
+++ includes/path.inc	13 Jan 2010 16:11:53 -0000
@@ -456,11 +456,14 @@ function path_load($conditions) {
 function path_save(&$path) {
   $path += array('pid' => NULL, 'language' => LANGUAGE_NONE);
 
+  // Allow modules to alter the alias before saving.
+  drupal_alter('path', $path);
+
   // Insert or update the alias.
   $status = drupal_write_record('url_alias', $path, (!empty($path['pid']) ? 'pid' : NULL));
 
   // Verify that a record was written.
-  if (isset($status) && $status) {
+  if (!empty($status)) {
     if ($status === SAVED_NEW) {
       module_invoke_all('path_insert', $path);
     }
Index: modules/path/path.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.api.php,v
retrieving revision 1.1
diff -u -p -r1.1 path.api.php
--- modules/path/path.api.php	17 Oct 2009 00:52:36 -0000	1.1
+++ modules/path/path.api.php	13 Jan 2010 16:11:55 -0000
@@ -11,6 +11,14 @@
  * @{
  */
 
+/**
+ * Perform alterations to an URL alias before it is saved.
+ *
+ * @param $path
+ *   The path array.
+ */
+function hook_path_alter(&$path) {
+}
 
 /**
  * The path has been inserted.
