Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fun.git;a=commitdiff;h=54fe648df0dfef6a99e4c76ab1a03b59227f3faf

commit 54fe648df0dfef6a99e4c76ab1a03b59227f3faf
Author: Priyank <[EMAIL PROTECTED]>
Date:   Sun Mar 30 16:42:05 2008 +0530

Prevent a segfault when downloading news items for the first time
* Create .fun/news if it doesn't exist

diff --git a/src/fun-news_backend.c b/src/fun-news_backend.c
index 87a3541..f50b486 100644
--- a/src/fun-news_backend.c
+++ b/src/fun-news_backend.c
@@ -461,11 +461,15 @@ fun_news_rss_fetch_thread (void *ptr)
FILE            *outfile;
gchar           *url = ptr;
gchar           *path = NULL;
+       gchar           *dir = NULL;

curl = curl_easy_init ();
if (curl)
{
path = cfg_get_path_to_config_file (NEWS_XML);
+               dir = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir(), 
NEWS_ITEM_DIR, NULL);
+               g_mkdir_with_parents (dir, 0755);
+               g_free (dir);
outfile = fopen (path, "w");

curl_easy_setopt (curl, CURLOPT_URL, url);
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to