From bd401d9517ff32b29a807143ab2b5cf89fcb286e Mon Sep 17 00:00:00 2001 From: julianeisel Date: Mon, 10 Nov 2014 20:29:44 +0100 Subject: Fix T42498: Disable Renaming for Read-Only Files in File Browser --- source/blender/editors/space_file/file_ops.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 27d6fabba4e..13beba3fff8 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1498,6 +1498,15 @@ static int file_rename_poll(bContext *C) SpaceFile *sfile = CTX_wm_space_file(C); if (sfile && sfile->params) { + int idx = sfile->params->active_file; + + if (idx >= 0) { + struct direntry *file = filelist_file(sfile->files, idx); + if (STREQ(file->relname, "..") || STREQ(file->relname, ".")) { + poll = 0; + } + } + if (sfile->params->active_file < 0) { poll = 0; } -- cgit v1.2.3