X-Debbugs-CC: debian-hurd@lists.debian.org
Dear Maintainer,
Refreshing the patch fixing the FTBFS on the hurd to version 3.11 of netsurf.
I don't know if the framebuffer package should be built on the hurd. With the
attached patch the package builds, but when I try to run the program with the
SDL frontend, it crashes. But perhaps it is not expected to work.
In any case that would be the case for a separate bug report.
Many thanks,
João
--- netsurf-3.11.orig/netsurf/frontends/framebuffer/fetch.c
+++ netsurf-3.11/netsurf/frontends/framebuffer/fetch.c
@@ -48,13 +48,16 @@
*/
static nsurl *get_resource_url(const char *path)
{
- char buf[PATH_MAX];
+ char *buf = NULL;
nsurl *url = NULL;
if (strcmp(path, "favicon.ico") == 0)
path = "favicon.png";
- netsurf_path_to_nsurl(filepath_sfind(respaths, buf, path), );
+ buf = filepath_find(respaths, path);
+ netsurf_path_to_nsurl(buf, );
+
+ free(buf);
return url;
}
--- netsurf-3.11.orig/netsurf/frontends/framebuffer/font_freetype.c
+++ netsurf-3.11/netsurf/frontends/framebuffer/font_freetype.c
@@ -120,15 +120,16 @@ fb_new_face(const char *option, const ch
fb_faceid_t *newf;
FT_Error error;
FT_Face aface;
- char buf[PATH_MAX];
+ char *buf = NULL;
newf = calloc(1, sizeof(fb_faceid_t));
if (option != NULL) {
newf->fontfile = strdup(option);
} else {
- filepath_sfind(respaths, buf, fontname);
+ buf = filepath_find(respaths, fontname);
newf->fontfile = strdup(buf);
+ free(buf);
}
error = FTC_Manager_LookupFace(ft_cmanager, (FTC_FaceID)newf, );
--- netsurf-3.11.orig/netsurf/frontends/gtk/fetch.c
+++ netsurf-3.11/netsurf/frontends/gtk/fetch.c
@@ -250,14 +250,16 @@ const char *fetch_filetype(const char *u
static nsurl *nsgtk_get_resource_url(const char *path)
{
- char buf[PATH_MAX];
+ char *buf = NULL;
nsurl *url = NULL;
/* favicon.ico -> favicon.png */
if (strcmp(path, "favicon.ico") == 0) {
nsurl_create("resource:favicon.png", );
} else {
- netsurf_path_to_nsurl(filepath_sfind(respaths, buf, path), );
+ buf = filepath_find(respaths, path);
+ netsurf_path_to_nsurl(buf, );
+ free(buf);
}
return url;
--- netsurf-3.11.orig/netsurf/frontends/gtk/gui.c
+++ netsurf-3.11/netsurf/frontends/gtk/gui.c
@@ -909,8 +909,8 @@ static nserror nsgtk_add_named_icons_to_
*/
static nserror nsgtk_setup(int argc, char** argv, char **respath)
{
- char buf[PATH_MAX];
- char *resource_filename;
+ char *buf = NULL;
+ char *resource_filename = NULL;
char *addr = NULL;
nsurl *url;
nserror res;
@@ -986,8 +986,9 @@ static nserror nsgtk_setup(int argc, cha
.pma = true,
});
- filepath_sfinddef(respath, buf, "mime.types", "/etc/");
+ buf = filepath_sfinddef(respath, "mime.types", "/etc/");
gtk_fetch_filetype_init(buf);
+ free(buf);
save_complete_init();
--- netsurf-3.11.orig/netsurf/frontends/monkey/fetch.c
+++ netsurf-3.11/netsurf/frontends/monkey/fetch.c
@@ -36,10 +36,12 @@ extern char **respaths;
static nsurl *gui_get_resource_url(const char *path)
{
- char buf[PATH_MAX];
+ char *buf = NULL;
nsurl *url = NULL;
- netsurf_path_to_nsurl(filepath_sfind(respaths, buf, path), );
+ buf = filepath_find(respaths, path);
+ netsurf_path_to_nsurl(buf, );
+ free(buf);
return url;
}
--- netsurf-3.11.orig/netsurf/frontends/monkey/main.c
+++ netsurf-3.11/netsurf/frontends/monkey/main.c
@@ -390,7 +390,7 @@ main(int argc, char **argv)
{
char *messages;
char *options;
- char buf[PATH_MAX];
+ char *buf = NULL;
nserror ret;
struct netsurf_table monkey_table = {
.misc = _misc_table,
@@ -452,8 +452,9 @@ main(int argc, char **argv)
die("NetSurf failed to initialise");
}
- filepath_sfinddef(respaths, buf, "mime.types", "/etc/");
+ buf = filepath_sfinddef(respaths, "mime.types", "/etc/");
monkey_fetch_filetype_init(buf);
+ free(buf);
urldb_load(nsoption_charp(url_file));
urldb_load_cookies(nsoption_charp(cookie_file));
--- netsurf-3.11.orig/netsurf/frontends/windows/fetch.c
+++ netsurf-3.11/netsurf/frontends/windows/fetch.c
@@ -76,10 +76,12 @@ static const char *fetch_filetype(const
*/
static nsurl *nsw32_get_resource_url(const char *path)
{
- char buf[PATH_MAX];
+ char *buf = NULL;
nsurl *url = NULL;
- netsurf_path_to_nsurl(filepath_sfind(G_resource_pathv, buf, path), );
+ buf = filepath_find(G_resource_pathv, path);
+ netsurf_path_to_nsurl(buf, );
+ free(buf);
return url;
}
--- netsurf-3.11.orig/netsurf/frontends/windows/main.c
+++ netsurf-3.11/netsurf/frontends/windows/main.c
@@ -171,12 +171,13 @@ static nserror set_defaults(struct nsopt
DWORD buf_bytes_size = sizeof(TCHAR) * buf_tchar_size;
char *ptr = NULL;
char *buf;
+ char *buftest;
char *fname;
HRESULT hres;
char dldir[] = "Downloads";
buf = malloc(buf_bytes_size);
- if (buf== NULL) {
+ if (buf == NULL) {
return NSERROR_NOMEM;
}
buf[0] = '\0';
@@ -191,8 +192,9 @@ static nserror set_defaults(struct nsopt
if