=== modified file 'includes/menu.inc'
--- includes/menu.inc	2007-10-12 14:10:17 +0000
+++ includes/menu.inc	2007-10-16 07:03:46 +0000
@@ -1757,6 +1757,40 @@ function _menu_find_router_path($menu, $
   return $router_path;
 }
 
+/**
+ * This function helps your module maintains its links.
+ *
+ * It will insert, update or delete an uncustomized link belonging to a
+ * certain module pointing to the given path.
+ *
+ * @param $module
+ *   The name of the module.
+ * @param $op
+ *   insert, uodate or delete.
+ * @param $link_path
+ *   The path this link points to.
+ * @param $link_title
+ *   The title of the link. Unused for delete.
+ */
+function menu_link_maintain($module, $op, $link_path, $link_title) {
+  switch ($op) {
+    case 'insert':
+      $menu_link = array(
+        'link_title' => $link_title,
+        'link_path' => $link_path,
+        'module' => $module,
+      );
+      menu_link_save($menu_link);
+      break;
+    case 'update':
+      db_query("UPDATE {menu_links} SET link_title = '%s' WHERE link_path = '%s' AND customized = 0 AND module  = '%s'", $link_title, $link_path, $module);
+      menu_cache_clear();
+      break;
+    case 'delete':
+      menu_link_delete(NULL, $link_path);
+      break;
+  }
+}
 
 /**
  * Find the depth of an item's children relative to its depth.

=== modified file 'modules/aggregator/aggregator.module'
--- modules/aggregator/aggregator.module	2007-09-13 08:02:38 +0000
+++ modules/aggregator/aggregator.module	2007-10-16 07:04:17 +0000
@@ -353,15 +353,27 @@ function aggregator_block($op = 'list', 
  * Add/edit/delete aggregator categories.
  */
 function aggregator_save_category($edit) {
-  if (!empty($edit['cid']) && !empty($edit['title'])) {
-    db_query("UPDATE {aggregator_category} SET title = '%s', description = '%s' WHERE cid = %d", $edit['title'], $edit['description'], $edit['cid']);
-  }
-  else if (!empty($edit['cid'])) {
-    db_query('DELETE FROM {aggregator_category} WHERE cid = %d', $edit['cid']);
+  $link_path = 'aggregator/categories/';
+  if (!empty($edit['cid'])) {
+    $link_path .= $edit['cid'];
+    if (!empty($edit['title'])) {
+      db_query("UPDATE {aggregator_category} SET title = '%s', description = '%s' WHERE cid = %d", $edit['title'], $edit['description'], $edit['cid']);
+      $op = 'update';
+    }
+    else {
+      db_query('DELETE FROM {aggregator_category} WHERE cid = %d', $edit['cid']);
+      $edit['title'] = '';
+      $op = 'delete';
+    }
   }
   else if (!empty($edit['title'])) {
     // A single unique id for bundles and feeds, to use in blocks
     db_query("INSERT INTO {aggregator_category} (title, description, block) VALUES ('%s', '%s', 5)", $edit['title'], $edit['description']);
+    $link_path .= db_last_insert_id('aggregator', 'cid');
+    $op = 'insert';
+  }
+  if (isset($op)) {
+    menu_link_maintain('aggregator', $op, $link_path, $edit['title']);
   }
 }
 

=== modified file 'modules/aggregator/aggregator.pages.inc'
--- modules/aggregator/aggregator.pages.inc	2007-10-02 16:03:17 +0000
+++ modules/aggregator/aggregator.pages.inc	2007-10-16 07:03:46 +0000
@@ -39,6 +39,7 @@ function aggregator_page_source($arg1, $
  * Menu callback; displays all the items aggregated in a particular category.
  */
 function aggregator_page_category($arg1, $arg2 = NULL) {
+  drupal_set_breadcrumb(array_merge(drupal_get_breadcrumb(), array(l(t('Categories'), 'aggregator/categories'))));
   // If there are two arguments then we are called as a form, $arg1 is
   // $form_state and $arg2 is $category. Otherwise, $arg1 is $category.
   $category = is_array($arg2) ? $arg2 : $arg1;

