[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29942] trunk/blender/source/blender: fix for 2 bugs in own recent commits,

Campbell Barton ideasman42 at gmail.com
Sun Jul 4 19:14:06 CEST 2010


Revision: 29942
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29942
Author:   campbellbarton
Date:     2010-07-04 19:14:06 +0200 (Sun, 04 Jul 2010)

Log Message:
-----------
fix for 2 bugs in own recent commits, 
- 29881 broke BLI_stringdec in some cases.
- poll function for view home crashed view menu because the rv3d isnt available (still needs fixing).

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/path_util.c
    trunk/blender/source/blender/editors/space_view3d/view3d_edit.c

Modified: trunk/blender/source/blender/blenlib/intern/path_util.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/path_util.c	2010-07-04 16:47:58 UTC (rev 29941)
+++ trunk/blender/source/blender/blenlib/intern/path_util.c	2010-07-04 17:14:06 UTC (rev 29942)
@@ -105,12 +105,18 @@
 	}
 	if (found) {
 		if (tail) strcpy(tail, &string[nume+1]);
-		if (head) BLI_strncpy(head, string, nums);
+		if (head) {
+			strcpy(head,string);
+			head[nums]=0;
+		}
 		if (numlen) *numlen = nume-nums+1;
 		return ((int)atoi(&(string[nums])));
 	}
 	if (tail) strcpy(tail, string + len);
-	if (head) BLI_strncpy(head, string, nums);
+	if (head) {
+		strncpy(head, string, len);
+		head[len] = '\0';
+	}
 	if (numlen) *numlen=0;
 	return 0;
 }

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_edit.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_edit.c	2010-07-04 16:47:58 UTC (rev 29941)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_edit.c	2010-07-04 17:14:06 UTC (rev 29942)
@@ -1309,8 +1309,8 @@
 static int viewhome_poll(bContext *C)
 {
 	if(ED_operator_view3d_active(C)) {
-		RegionView3D *rv3d= CTX_wm_region_view3d(C);
-		if(rv3d->persp!=RV3D_CAMOB) {
+		RegionView3D *rv3d= CTX_wm_region_view3d(C); //XXX, when accessed from a header menu this doesnt work!
+		if(rv3d && rv3d->persp!=RV3D_CAMOB) {
 			return 1;
 		}
 	}





More information about the Bf-blender-cvs mailing list