SF.net SVN: geany:[4341] trunk/src/utils.c

ntrel at users.sourceforge.net ntrel at xxxxx
Mon Oct 19 15:19:09 UTC 2009


Revision: 4341
          http://geany.svn.sourceforge.net/geany/?rev=4341&view=rev
Author:   ntrel
Date:     2009-10-19 15:19:09 +0000 (Mon, 19 Oct 2009)

Log Message:
-----------
Avoid allocating GError in utils_get_setting_string().

Modified Paths:
--------------
    trunk/src/utils.c

Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c	2009-10-19 14:58:51 UTC (rev 4340)
+++ trunk/src/utils.c	2009-10-19 15:19:09 UTC (rev 4341)
@@ -806,15 +806,13 @@
 								const gchar *default_value)
 {
 	gchar *tmp;
-	GError *error = NULL;
 
 	if (G_UNLIKELY(config == NULL))
 		return g_strdup(default_value);
 
-	tmp = g_key_file_get_string(config, section, key, &error);
-	if (G_UNLIKELY(error))
+	tmp = g_key_file_get_string(config, section, key, NULL);
+	if (G_UNLIKELY(!tmp))
 	{
-		g_error_free(error);
 		return g_strdup(default_value);
 	}
 	return tmp;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list