summaryrefslogtreecommitdiff
path: root/desktop/hotlist.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-08-29 13:08:04 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2013-08-29 13:08:04 +0100
commitbc0571b9dc2719ac8218f9523627d55ff1016b04 (patch)
tree1a99b1e043505a455256f767905887d46050883e /desktop/hotlist.c
parentc56560c2ac0e4a7ce61bb987b941f7ac60e666a7 (diff)
downloadnetsurf-bc0571b9dc2719ac8218f9523627d55ff1016b04.tar.gz
netsurf-bc0571b9dc2719ac8218f9523627d55ff1016b04.tar.bz2
Better handling of added entry titles.
Diffstat (limited to 'desktop/hotlist.c')
-rw-r--r--desktop/hotlist.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/desktop/hotlist.c b/desktop/hotlist.c
index 2eb723584..79e1061d2 100644
--- a/desktop/hotlist.c
+++ b/desktop/hotlist.c
@@ -296,9 +296,9 @@ static nserror hotlist_add_folder_internal(
if (title == NULL) {
/* TODO: use messages */
title = strdup("New folder");
- }
- if (title == NULL) {
- return NSERROR_NOMEM;
+ if (title == NULL) {
+ return NSERROR_NOMEM;
+ }
}
/* Create the title field */
@@ -1330,13 +1330,21 @@ nserror hotlist_add_entry(nsurl *url, const char *title, bool at_y, int y)
nsurl_ref(url);
}
+ if (title != NULL) {
+ title = strdup(title);
+ if (title == NULL) {
+ nsurl_ref(url);
+ return NSERROR_NOMEM;
+ }
+ }
+
err = treeview_get_relation(hl_ctx.tree, &relation, &rel, at_y, y);
if (err != NSERROR_OK) {
nsurl_unref(url);
return err;
}
- err = hotlist_add_entry_internal(url, NULL, NULL,
+ err = hotlist_add_entry_internal(url, title, NULL,
relation, rel, &entry);
if (err != NSERROR_OK) {
nsurl_unref(url);