Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_file/file_ops.c')
-rw-r--r--source/blender/editors/space_file/file_ops.c19
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);