diff --git a/amiga/gui.c b/amiga/gui.c index 2592352b7..b7edf5e1e 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -37,6 +37,7 @@ #include "utils/nsoption.h" #include "utils/utf8.h" #include "utils/utils.h" +#include "utils/nsurl.h" #include "utils/file.h" /* NetSurf Amiga platform includes */ @@ -912,9 +913,9 @@ static void gui_init2(int argc, char** argv) AddPart(fullpath,wbarg->wa_Name,1024); if(!temp_homepage_url) { - nsurl temp_url; + nsurl *temp_url; if (netsurf_path_to_nsurl(fullpath, &temp_url) == NSERROR_OK) { - temp_homepage_url = strcpy(nsurl_data(temp_url)); + temp_homepage_url = strdup(nsurl_data(temp_url)); nsurl_unref(temp_url); } } diff --git a/amiga/icon.c b/amiga/icon.c index 95fd685cd..d0e1c847d 100644 --- a/amiga/icon.c +++ b/amiga/icon.c @@ -47,6 +47,7 @@ #include "utils/messages.h" #include "utils/utils.h" #include "utils/url.h" +#include "utils/file.h" #define THUMBNAIL_WIDTH 100 /* Icon sizes for thumbnails, usually the same as */ #define THUMBNAIL_HEIGHT 86 /* WIDTH/HEIGHT in desktop/thumbnail.c */ diff --git a/amiga/misc.c b/amiga/misc.c index d2b243a24..ac9912f5b 100755 --- a/amiga/misc.c +++ b/amiga/misc.c @@ -34,6 +34,7 @@ #include "amiga/utf8.h" #include "desktop/cookie_manager.h" #include "utils/log.h" +#include "utils/corestrings.h" #include "utils/messages.h" #include "utils/url.h" #include "utils/file.h" diff --git a/atari/misc.c b/atari/misc.c index a84ce2bd3..849eec9ec 100755 --- a/atari/misc.c +++ b/atari/misc.c @@ -246,10 +246,6 @@ hlcache_handle *load_icon(const char *name, hlcache_handle_callback cb, nsurl_unref(icon_nsurl); - /* If we built the URL here, free it */ - if (url != NULL) - free(url); - if (err != NSERROR_OK) { return NULL; } diff --git a/riscos/gui.c b/riscos/gui.c index 51472a4bf..82a1a74a1 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -57,6 +57,7 @@ #include "utils/messages.h" #include "utils/url.h" #include "utils/utils.h" +#include "utils/corestrings.h" #include "content/content.h" #include "content/hlcache.h" #include "content/urldb.h" @@ -746,7 +747,7 @@ static nserror ro_path_to_nsurl(const char *path, struct nsurl **url_out) char *unix_path; /* unix path */ char *escurl; os_error *error; - nserror url_err; + nserror ret; int urllen; char *url; /* resulting url */ @@ -801,10 +802,10 @@ static nserror ro_path_to_nsurl(const char *path, struct nsurl **url_out) free(unix_path); /* We don't want '/' to be escaped. */ - url_err = url_escape(url, FILE_SCHEME_PREFIX_LEN, false, "/", &escurl); + ret = url_escape(url, FILE_SCHEME_PREFIX_LEN, false, "/", &escurl); free(url); - if (url_err != NSERROR_OK) { - return url_err; + if (ret != NSERROR_OK) { + return ret; } ret = nsurl_create(escurl, url_out); diff --git a/windows/gui.c b/windows/gui.c index fe0c52249..8cf36d020 100644 --- a/windows/gui.c +++ b/windows/gui.c @@ -44,6 +44,8 @@ #include "utils/messages.h" #include "utils/utils.h" #include "utils/file.h" +#include "utils/corestrings.h" +#include "utils/url.h" #include "windows/window.h" #include "windows/about.h" diff --git a/windows/main.c b/windows/main.c index 637aa217f..f9792c259 100644 --- a/windows/main.c +++ b/windows/main.c @@ -26,10 +26,12 @@ #include "desktop/gui.h" #include "utils/nsoption.h" #include "desktop/browser.h" +#include "desktop/netsurf.h" #include "utils/utils.h" #include "utils/log.h" #include "utils/messages.h" #include "utils/filepath.h" +#include "utils/file.h" #include "content/fetchers/resource.h" #include "windows/findfile.h"