[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13622] trunk/blender/source/blender/ python/BPY_menus.c: == BPy: scripts in menus ==

Willian Padovani Germano wpgermano at gmail.com
Sun Feb 10 03:12:08 CET 2008


Revision: 13622
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13622
Author:   ianwill
Date:     2008-02-10 03:12:06 +0100 (Sun, 10 Feb 2008)

Log Message:
-----------
== BPy: scripts in menus ==

Fixing compile warning (about a var that was always true being used as condition in an "if" block).

Modified Paths:
--------------
    trunk/blender/source/blender/python/BPY_menus.c

Modified: trunk/blender/source/blender/python/BPY_menus.c
===================================================================
--- trunk/blender/source/blender/python/BPY_menus.c	2008-02-10 00:14:29 UTC (rev 13621)
+++ trunk/blender/source/blender/python/BPY_menus.c	2008-02-10 02:12:06 UTC (rev 13622)
@@ -457,6 +457,7 @@
 {
 	FILE *fp;
 	char line[255], w1[255], w2[255], tooltip[255], *tip;
+	char upythondir[FILE_MAXDIR];
 	char *homedir = NULL;
 	int parsing, version, is_userdir;
 	short group;
@@ -492,16 +493,15 @@
 	 * current one.  If so, return to force updating from dirs */
 	w1[0] = '\0';
 	fscanf( fp, "# User defined scripts dir: %[^\n]\n", w1 );
-	if( w1 ) {
-		char upythondir[FILE_MAXDIR];
 
-		BLI_strncpy(upythondir, U.pythondir, FILE_MAXDIR);
-		BLI_convertstringcode(upythondir, G.sce, 0);
-		if( strcmp( w1, upythondir ) != 0 )
-			return -1;
-		w1[0] = '\0';
-	}
+	BLI_strncpy(upythondir, U.pythondir, FILE_MAXDIR);
+	BLI_convertstringcode(upythondir, G.sce, 0);
 
+	if( strcmp( w1, upythondir ) != 0 )
+		return -1;
+
+	w1[0] = '\0';
+
 	while( fgets( line, 255, fp ) ) {	/* parsing file lines */
 
 		switch ( line[0] ) {	/* check first char */





More information about the Bf-blender-cvs mailing list