[freenet-cvs] r14737 - trunk/freenet/src/freenet/clients/http/bookmark

nextgens at freenetproject.org nextgens at freenetproject.org
Fri Aug 17 00:27:52 UTC 2007


Author: nextgens
Date: 2007-08-17 00:27:51 +0000 (Fri, 17 Aug 2007)
New Revision: 14737

Modified:
   trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java
Log:
Fix my 1.5ism and add some paranoia checks

Modified: trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java	2007-08-17 00:07:18 UTC (rev 14736)
+++ trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java	2007-08-17 00:27:51 UTC (rev 14737)
@@ -179,11 +179,14 @@
 		Bookmark bookmark = getBookmarkByPath(path);
 		
 		String oldName = bookmark.getName();
+		String oldPath = '/' + oldName + '/';
+		String newPath = oldPath.substring(0, oldPath.indexOf(oldName)) + newName + '/';
+
 		bookmark.setName(newName);
 		
 		bookmarks.remove(path);
-		bookmarks.put(path.replace(oldName, newName), bookmark);
-		
+		bookmarks.put(newPath, bookmark);
+
 		node.storeConfig();
 	}
 




More information about the cvs mailing list