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).
This commit is contained in:
Campbell Barton
2010-07-04 17:14:06 +00:00
parent 574d307635
commit 15de21e438
2 changed files with 10 additions and 4 deletions

View File

@@ -105,12 +105,18 @@ int BLI_stringdec(const char *string, char *head, char *tail, unsigned short *nu
}
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;
}

View File

@@ -1309,8 +1309,8 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.
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;
}
}