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/src/editimasel.c')
-rw-r--r--source/blender/src/editimasel.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/src/editimasel.c b/source/blender/src/editimasel.c
index 97ddc2e0f1d..8335af21247 100644
--- a/source/blender/src/editimasel.c
+++ b/source/blender/src/editimasel.c
@@ -959,10 +959,15 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
{
error("Path too long, cannot enter this directory");
} else {
- strcat(simasel->dir, file->relname);
- strcat(simasel->dir,"/");
- simasel->file[0] = '\0';
- BLI_cleanup_dir(G.sce, simasel->dir);
+ if (strcmp(file->relname, "..")==0) {
+ /* avoids /../../ */
+ BLI_parent_dir(simasel->dir);
+ } else {
+ strcat(simasel->dir, file->relname);
+ strcat(simasel->dir,"/");
+ simasel->file[0] = '\0';
+ BLI_cleanup_dir(G.sce, simasel->dir);
+ }
BIF_filelist_setdir(simasel->files, simasel->dir);
BIF_filelist_free(simasel->files);
simasel->active_file = -1;