[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r25330 - gnunet-gtk/src/lib
From: |
gnunet |
Subject: |
[GNUnet-SVN] r25330 - gnunet-gtk/src/lib |
Date: |
Sat, 8 Dec 2012 22:40:17 +0100 |
Author: grothoff
Date: 2012-12-08 22:40:16 +0100 (Sat, 08 Dec 2012)
New Revision: 25330
Modified:
gnunet-gtk/src/lib/eventloop.c
Log:
first, use GNUnet (not gnunet-gtk) prefix for locating default configuration
files; then _also_ try loading gnunet-gtk-based config-files -- fixes #2648
Modified: gnunet-gtk/src/lib/eventloop.c
===================================================================
--- gnunet-gtk/src/lib/eventloop.c 2012-12-08 21:38:04 UTC (rev 25329)
+++ gnunet-gtk/src/lib/eventloop.c 2012-12-08 21:40:16 UTC (rev 25330)
@@ -828,6 +828,7 @@
struct GNUNET_GTK_MainLoop *ml = cls;
struct GNUNET_CONFIGURATION_Handle *gcfg;
char *baseconfig;
+ char *ipath2;
char *ipath;
int argc;
@@ -838,16 +839,31 @@
gtk_init (&argc, (char ***) &args);
gcfg = GNUNET_CONFIGURATION_create ();
- ipath = GNUNET_GTK_installation_get_path (GNUNET_OS_IPK_DATADIR);
- if (ipath == NULL)
+ if (NULL == (ipath = GNUNET_OS_installation_get_path
(GNUNET_OS_IPK_DATADIR)))
{
GNUNET_break (0);
return;
}
GNUNET_asprintf (&baseconfig, "%s%s", ipath, "config.d");
- GNUNET_free (ipath);
(void) GNUNET_CONFIGURATION_load_from (gcfg, baseconfig);
GNUNET_free (baseconfig);
+
+ if (NULL == (ipath2 = GNUNET_GTK_installation_get_path
(GNUNET_OS_IPK_DATADIR)))
+ {
+ GNUNET_break (0);
+ return;
+ }
+ if (0 != strcmp (ipath, ipath2))
+ {
+ GNUNET_asprintf (&baseconfig, "%s%s", ipath, "config.d");
+ if (GNUNET_YES ==
+ GNUNET_DISK_directory_test (baseconfig, GNUNET_YES))
+ (void) GNUNET_CONFIGURATION_load_from (gcfg, baseconfig);
+ GNUNET_free (baseconfig);
+ }
+ GNUNET_free (ipath2);
+ GNUNET_free (ipath);
+
(void) GNUNET_CONFIGURATION_load (gcfg, cfgfile);
ml->rs = GNUNET_NETWORK_fdset_create ();
ml->ws = GNUNET_NETWORK_fdset_create ();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r25330 - gnunet-gtk/src/lib,
gnunet <=