summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Mardegan <mardy@users.sourceforge.net>2007-03-16 13:45:29 +0000
committerAlberto Mardegan <mardy@users.sourceforge.net>2007-03-16 13:45:29 +0000
commit3609036ff1c656a4ed5bec06959a6217db44c52e (patch)
treeb3a2c7146671d8224183d11b8428d41cad2992f2
parentaefbebec7815d5d53254cdecdf77c4f2021f65f8 (diff)
Gracefully handle the lack of a Capabilities field in the .profile
config file. git-svn-id: https://mission-control.svn.sourceforge.net/svnroot/mission-control/trunk@11 d91c8aed-3f2b-0410-a83d-924a1c20a0ba
-rw-r--r--ChangeLog4
-rw-r--r--libmissioncontrol/mc-profile.c11
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 29328ca3..f6a7e3ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2007-03-16 Alberto Mardegan <alberto.mardegan@nokia.com>
+ * libmissioncontrol/mc-profile.c:
+ Gracefully handle the lack of a Capabilities field in the .profile
+ config file.
+
* configure.ac:
Use the autotools' "datadir" variable to determine the location of the
profiles.
diff --git a/libmissioncontrol/mc-profile.c b/libmissioncontrol/mc-profile.c
index d763db83..6754ece8 100644
--- a/libmissioncontrol/mc-profile.c
+++ b/libmissioncontrol/mc-profile.c
@@ -266,9 +266,14 @@ _mc_profile_load (McProfile *profile)
/* :D */
caps = g_key_file_get_string (keyfile, PROFILE_GROUP, "Capabilities", NULL);
- g_strdelimit (caps, " ,;", ':');
- priv->capabilities = g_parse_debug_string (caps, capabilities, sizeof (capabilities) / sizeof (GDebugKey));
- g_free (caps);
+ if (caps)
+ {
+ g_strdelimit (caps, " ,;", ':');
+ priv->capabilities =
+ g_parse_debug_string (caps, capabilities,
+ sizeof (capabilities) / sizeof (GDebugKey));
+ g_free (caps);
+ }
priv->default_settings = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free,