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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-02-17 21:11:47 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-02-17 21:13:22 +0300
commit21a2b73a1e0eff0f48fe93161779bd71f8f141f7 (patch)
tree447d2c34cca51e67ad9f31f3b1d8d1e6ddff9346 /source/blender/editors/space_file/fsmenu.c
parente6f40b4cebe58f1e9785aef6938ae4d3441c4142 (diff)
Fix T43684 (again!): Mighty Windows thinks it’s perfectly sensible to block everyone during 5 seconds for a mere stat() call on "A:\" path...
For now, just always consider those floppy entries ("A:\" and "B:\") as valid... sigh.
Diffstat (limited to 'source/blender/editors/space_file/fsmenu.c')
-rw-r--r--source/blender/editors/space_file/fsmenu.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index f717573d965..0cbb31b5f5a 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -219,6 +219,20 @@ void ED_fsmenu_entry_set_name(struct FSMenuEntry *fsentry, const char *name)
void fsmenu_entry_refresh_valid(struct FSMenuEntry *fsentry)
{
if (fsentry->path && fsentry->path[0]) {
+ /* XXX Special case, always consider those as valid.
+ * Thanks to Windows, which can spend five seconds to perform a mere stat() call on those paths...
+ * See T43684.
+ */
+ const char *exceptions[] = {"A:\\", "B:\\", NULL};
+ const size_t exceptions_len[] = {strlen(exceptions[0]), strlen(exceptions[1]), 0};
+ int i;
+
+ for (i = 0; exceptions[i]; i++) {
+ if (STREQLEN(fsentry->path, exceptions[i], exceptions_len[i])) {
+ fsentry->valid = true;
+ return;
+ }
+ }
fsentry->valid = BLI_is_dir(fsentry->path);
}
else {