From c406ce29742fd44995f29768e593f00a7805df2c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 17 May 2012 10:07:29 +0000 Subject: minor improvement - entering "//somepath" in the file selector didnt expand from the current blend files path. also quiet warning. --- source/blender/editors/space_file/file_ops.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index f340c53f528..3ff9c3c0520 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1099,7 +1099,11 @@ static void file_expand_directory(bContext *C) SpaceFile *sfile= CTX_wm_space_file(C); if (sfile->params) { - if ( sfile->params->dir[0] == '~' ) { + /* TODO, what about // when relbase isn't valid? */ + if (G.relbase_valid && strncmp(sfile->params->dir, "//", 2) == 0) { + BLI_path_abs(sfile->params->dir, G.main->name); + } + else if (sfile->params->dir[0] == '~') { char tmpstr[sizeof(sfile->params->dir)-1]; BLI_strncpy(tmpstr, sfile->params->dir+1, sizeof(tmpstr)); BLI_join_dirfile(sfile->params->dir, sizeof(sfile->params->dir), BLI_getDefaultDocumentFolder(), tmpstr); -- cgit v1.2.3