Author: nextgens
Date: 2007-11-19 19:26:00 +0000 (Mon, 19 Nov 2007)
New Revision: 15846

Modified:
   trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java
Log:
BookmarkToadlet: Fix the long-standing bug preventing bookmarks from beeing 
re-edited

Modified: trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java        
2007-11-19 19:19:15 UTC (rev 15845)
+++ trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java        
2007-11-19 19:26:00 UTC (rev 15846)
@@ -210,13 +210,18 @@

                String oldName = bookmark.getName();
                String oldPath = '/' + oldName + '/';
-               String newPath = oldPath.substring(0, oldPath.indexOf(oldName)) 
+ newName + '/';
+               String newPath = oldPath.substring(0, oldPath.indexOf(oldName)) 
+ newName;

                bookmark.setName(newName);
-               
                bookmarks.remove(path);
-               bookmarks.put(newPath, bookmark);
+                if(path.charAt(path.length()-1) != '/') {
+                    int lastIndexOfSlash = path.lastIndexOf('/');
+                    newPath = path.substring(0,lastIndexOfSlash)+newPath;
+                } else
+                    newPath += '/';

+                bookmarks.put(newPath, bookmark);
+                
                node.storeConfig();
        }



Reply via email to