anjuta r4777 - in trunk: . libanjuta



Author: jhs
Date: Sat Feb 21 09:45:34 2009
New Revision: 4777
URL: http://svn.gnome.org/viewvc/anjuta?rev=4777&view=rev

Log:
2009-02-21  Johannes Schmid  <jhs gnome org>

	* libanjuta/anjuta-plugin-description.c
	(anjuta_plugin_description_new_from_string):
	* libanjuta/anjuta-plugin-handle.c (anjuta_plugin_handle_new):
	
	Fixed some errors reported by valgrind

Modified:
   trunk/ChangeLog
   trunk/libanjuta/anjuta-plugin-description.c
   trunk/libanjuta/anjuta-plugin-handle.c

Modified: trunk/libanjuta/anjuta-plugin-description.c
==============================================================================
--- trunk/libanjuta/anjuta-plugin-description.c	(original)
+++ trunk/libanjuta/anjuta-plugin-description.c	Sat Feb 21 09:45:34 2009
@@ -585,24 +585,23 @@
 
   parser.line = data;
 
-  /* Put any initial comments in a NULL segment */
-  open_section (&parser, NULL);
-  
-  while (parser.line && *parser.line)
-    {
-      if (*parser.line == '[') {
-	if (!parse_section_start (&parser, error))
-	  return NULL;
-      } else if (is_blank_line (&parser) ||
-		 *parser.line == '#')
-	parse_comment_or_blank (&parser);
-      else
-	{
-	  if (!parse_key_value (&parser, error))
-	    return NULL;
+	/* Put any initial comments in a NULL segment */
+	open_section (&parser, NULL);
+	while (parser.line != NULL && strlen(parser.line))
+	{ 
+		if (*parser.line == '[') {
+			if (!parse_section_start (&parser, error))
+				return NULL;
+		} else if (is_blank_line (&parser) ||
+		           *parser.line == '#')
+			parse_comment_or_blank (&parser);
+		else
+		{
+			if (!parse_key_value (&parser, error))
+				return NULL;
+		}
 	}
-    }
-
+ 
   return parser.df;
 }
 

Modified: trunk/libanjuta/anjuta-plugin-handle.c
==============================================================================
--- trunk/libanjuta/anjuta-plugin-handle.c	(original)
+++ trunk/libanjuta/anjuta-plugin-handle.c	Sat Feb 21 09:45:34 2009
@@ -472,8 +472,8 @@
 	AnjutaPluginHandle *plugin_handle;
 	AnjutaPluginDescription *desc;
 	char *str;
-	gboolean *enable;
-	gchar *contents;
+	gboolean enable;
+	gchar *contents = NULL;
 	gboolean success = TRUE;
 	
 	/* Load file content */
@@ -544,8 +544,8 @@
 	}
 	
 	if (anjuta_plugin_description_get_boolean (desc, "Anjuta Plugin",
-											  "UserActivatable", &enable) && !enable) {
-		plugin_handle->priv->user_activatable = FALSE;
+											  "UserActivatable", &enable)) {
+		plugin_handle->priv->user_activatable = enable;
 		/*
 		DEBUG_PRINT ("Plugin '%s' is not user activatable",
 					 plugin_handle->priv->name?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]