]> git.street.me.uk Git - andy/viking.git/blobdiff - src/geonamessearch.c
Never willingly abort, remove exit() statements.
[andy/viking.git] / src / geonamessearch.c
index b63d3eed993a05010265d12624676967edef6424..f34b2ebbecae240d149ef9ebd578594f2a2813e4 100644 (file)
@@ -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);