From 1d225c6696a8fe6538922c7ab5963d547ba30dd2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 7 Nov 2011 15:55:03 +0000 Subject: use macro for access to library filepath --- source/blender/editors/space_buttons/buttons_ops.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_buttons') 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); -- cgit v1.2.3