diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-05-08 03:34:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-05-08 03:34:03 +0400 |
commit | 14b41f907803a1383075f497dfc7ab9bcb843ad8 (patch) | |
tree | 8f199dbce7f7dd244fbed4d2a257ed2f5d6e295c /source/blender/editors/space_file/file_ops.c | |
parent | b2b780f2fe9a97ce4ed97e9fc93ec05b6c4d906d (diff) |
bugfix [#22276] filemanager autocompleate based on current path
also added autocomp to filename in fileselector
Diffstat (limited to 'source/blender/editors/space_file/file_ops.c')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 85b3cee354b..ed098d2d44e 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -816,26 +816,15 @@ void FILE_OT_directory_new(struct wmOperatorType *ot) int file_directory_exec(bContext *C, wmOperator *unused) { - char tmpstr[FILE_MAX]; - SpaceFile *sfile= CTX_wm_space_file(C); if(sfile->params) { if ( sfile->params->dir[0] == '~' ) { - if (sfile->params->dir[1] == '\0') { - BLI_strncpy(sfile->params->dir, BLI_gethome(), sizeof(sfile->params->dir) ); - } else { - /* replace ~ with home */ - char homestr[FILE_MAX]; - char *d = &sfile->params->dir[1]; - - while ( (*d == '\\') || (*d == '/') ) - d++; - BLI_strncpy(homestr, BLI_gethome(), FILE_MAX); - BLI_join_dirfile(tmpstr, homestr, d); - BLI_strncpy(sfile->params->dir, tmpstr, sizeof(sfile->params->dir)); - } + char tmpstr[sizeof(sfile->params->dir)-1]; + strncpy(tmpstr, sfile->params->dir+1, sizeof(tmpstr)); + BLI_join_dirfile(sfile->params->dir, BLI_gethome(), tmpstr); } + #ifdef WIN32 if (sfile->params->dir[0] == '\0') get_default_root(sfile->params->dir); |