# HG changeset patch # User masneyb # Date 1099359920 0 # Node ID b60dad25b64163e06115748e5fc50180a37c42fa # Parent 5df5eac28f47c72e81279bb938b2cc029a2f05cd 2004-11-1 Brian Masney * lib/config_file.c (gftp_add_bookmark) - if the bookmark path ends in /, then force the entry to be a folder diff -r 5df5eac28f47 -r b60dad25b641 ChangeLog --- a/ChangeLog Tue Nov 02 01:33:26 2004 +0000 +++ b/ChangeLog Tue Nov 02 01:45:20 2004 +0000 @@ -1,4 +1,7 @@ 2004-11-1 Brian Masney + * lib/config_file.c (gftp_add_bookmark) - if the bookmark path ends in + /, then force the entry to be a folder + * src/gtk/gftp-gtk.c src/gtk/gftp-gtk.h src/gtk/misc-gtk.c - added a tooltip to the button on the top left of the GUI @@ -2996,7 +2999,7 @@ * cvsclean - added this script - * *.[ch] - added $Id: ChangeLog,v 1.354 2004/11/02 01:33:26 masneyb Exp $ tags + * *.[ch] - added $Id: ChangeLog,v 1.355 2004/11/02 01:45:20 masneyb Exp $ tags * debian/* - updated files from Debian maintainer diff -r 5df5eac28f47 -r b60dad25b641 lib/config_file.c --- a/lib/config_file.c Tue Nov 02 01:33:26 2004 +0000 +++ b/lib/config_file.c Tue Nov 02 01:45:20 2004 +0000 @@ -79,29 +79,38 @@ curpos++; } - /* Get the parent node */ - if ((curpos = strrchr (newentry->path, '/')) == NULL) - preventry = gftp_bookmarks; + if (newentry->path[strlen (newentry->path) - 1] == '/') + { + newentry->path[strlen (newentry->path) - 1] = '\0'; + newentry->isfolder = 1; + } else { - *curpos = '\0'; - preventry = (gftp_bookmarks_var *) - g_hash_table_lookup (gftp_bookmarks_htable, newentry->path); - *curpos = '/'; - } + /* Get the parent node */ + if ((curpos = strrchr (newentry->path, '/')) == NULL) + preventry = gftp_bookmarks; + else + { + *curpos = '\0'; + preventry = (gftp_bookmarks_var *) + g_hash_table_lookup (gftp_bookmarks_htable, newentry->path); + *curpos = '/'; + } + + if (preventry->children != NULL) + { + endentry = preventry->children; + while (endentry->next != NULL) + endentry = endentry->next; + endentry->next = newentry; + } + else + preventry->children = newentry; - if (preventry->children != NULL) - { - endentry = preventry->children; - while (endentry->next != NULL) - endentry = endentry->next; - endentry->next = newentry; + newentry->prev = preventry; + newentry->next = NULL; + g_hash_table_insert (gftp_bookmarks_htable, newentry->path, newentry); } - else - preventry->children = newentry; - newentry->prev = preventry; - newentry->next = NULL; - g_hash_table_insert (gftp_bookmarks_htable, newentry->path, newentry); }