diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-07 19:55:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-07 19:55:03 +0400 |
commit | 1d225c6696a8fe6538922c7ab5963d547ba30dd2 (patch) | |
tree | ad1448035a8d0f427cad56dd07e02f56d6a0dc40 /source/blender/editors | |
parent | a6828b9c6f2ec24853cccac16bfdfae870c0d8c2 (diff) |
use macro for access to library filepath
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_ops.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 39fae43a877..05fdcd50067 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -100,7 +100,7 @@ static int file_browse_exec(bContext *C, wmOperator *op) { FileBrowseOp *fbo= op->customdata; ID *id; - char *base, *str, path[FILE_MAX]; + char *str, path[FILE_MAX]; const char *path_prop= RNA_struct_find_property(op->ptr, "directory") ? "directory" : "filepath"; if (RNA_property_is_set(op->ptr, path_prop)==0 || fbo==NULL) @@ -113,10 +113,9 @@ static int file_browse_exec(bContext *C, wmOperator *op) char name[FILE_MAX]; id = fbo->ptr.id.data; - base = (id && id->lib)? id->lib->filepath: G.main->name; BLI_strncpy(path, str, FILE_MAX); - BLI_path_abs(path, base); + BLI_path_abs(path, id ? ID_BLEND_PATH(G.main, id) : G.main->name); if(BLI_is_dir(path)) { str = MEM_reallocN(str, strlen(str)+2); |