diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2015-07-26 18:11:58 +0100 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2015-10-24 15:12:57 +0100 |
commit | aabea8eceb8d77cef934e7b4d0cd2015f1103411 (patch) | |
tree | 6e7717e91b2e544bd1cf077592b63740fc5f5f3f /riscos/window.c | |
parent | 27adf07fb7752ede0d3a5f874d7c85f2e71c47c2 (diff) | |
download | netsurf-aabea8eceb8d77cef934e7b4d0cd2015f1103411.tar.gz netsurf-aabea8eceb8d77cef934e7b4d0cd2015f1103411.tar.bz2 |
Update RISC OS frontend to new API
Diffstat (limited to 'riscos/window.c')
-rw-r--r-- | riscos/window.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/riscos/window.c b/riscos/window.c index dbed46d2a..59c24ac8a 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -1038,16 +1038,20 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape) /* exported function documented in riscos/window.h */ nserror ro_gui_window_set_url(struct gui_window *g, nsurl *url) { - char *idn_url = NULL; + size_t idn_url_l; + char *idn_url_s = NULL; if (g->toolbar) { - if (nsoption_bool(display_decoded_idn) == false) { - ro_toolbar_set_url(g->toolbar, nsurl_access(url), true, false); - } else { - idn_url = nsurl_access_utf8(url); - ro_toolbar_set_url(g->toolbar, idn_url, true, false); - free(idn_url); + if (nsoption_bool(display_decoded_idn) == true) { + if (nsurl_access_utf8(url, &idn_url_s, &idn_url_l) != NSERROR_OK) + idn_url_s = NULL; } + + ro_toolbar_set_url(g->toolbar, idn_url_s ? idn_url_s : nsurl_access(url), true, false); + + if (idn_url_s) + free(idn_url_s); + ro_gui_url_complete_start(g->toolbar); } |