mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-17 01:33:16 +03:00
fix errors with path_to_url conversion
This commit is contained in:
parent
00b6cfc57e
commit
688f60d963
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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 */
|
||||
|
@ -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"
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user