X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/3349bab859844a2d15d806190b4da6d6859fecee..d84ade777eb0eb7a33c56c39c92b8c07cc66cd3a:/src/geonamessearch.c?ds=inline diff --git a/src/geonamessearch.c b/src/geonamessearch.c index b63d3eed..f34b2ebb 100644 --- a/src/geonamessearch.c +++ b/src/geonamessearch.c @@ -240,7 +240,7 @@ GList *a_select_geoname_from_list(GtkWindow *parent, GList *geonames, gboolean m return NULL; } -GList *get_entries_from_file(gchar *file_name) +static GList *get_entries_from_file(gchar *file_name) { gchar *text, *pat; GMappedFile *mf; @@ -261,7 +261,6 @@ GList *get_entries_from_file(gchar *file_name) if ((mf = g_mapped_file_new(file_name, FALSE, NULL)) == NULL) { g_critical(_("couldn't map temp file")); - exit(1); } len = g_mapped_file_get_length(mf); text = g_mapped_file_get_contents(mf); @@ -394,7 +393,7 @@ GList *get_entries_from_file(gchar *file_name) } -gchar *download_url(gchar *uri) +static gchar *download_url(gchar *uri) { FILE *tmp_file; int tmp_fd; @@ -402,12 +401,12 @@ gchar *download_url(gchar *uri) if ((tmp_fd = g_file_open_tmp ("vikgsearch.XXXXXX", &tmpname, NULL)) == -1) { g_critical(_("couldn't open temp file")); - exit(1); + return NULL; } tmp_file = fdopen(tmp_fd, "r+"); - // TODO: curl may not be available - if (curl_download_uri(uri, tmp_file, NULL, 0, NULL)) { // error + if (curl_download_uri(uri, tmp_file, NULL, 0, NULL)) { + // error fclose(tmp_file); tmp_file = NULL; g_remove(tmpname);