Fix T48111: Auto-run fails w/ empty paths

Enabling auto-run, then excluding a path but leaving it set to a blank value would ignore all paths.
This commit is contained in:
Campbell Barton 2016-06-03 15:28:32 +10:00
parent 528539ef59
commit 8c154d67b2
Notes: blender-bot 2023-02-14 07:59:40 +01:00
Referenced by issue #48111, Drivers/Auto-run Scripts issue on reload
1 changed files with 4 additions and 1 deletions

View File

@ -59,7 +59,10 @@ bool BKE_autoexec_match(const char *path)
BLI_assert((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0);
for (path_cmp = U.autoexec_paths.first; path_cmp; path_cmp = path_cmp->next) {
if ((path_cmp->flag & USER_PATHCMP_GLOB)) {
if (path_cmp->path[0] == '\0') {
/* pass */
}
else if ((path_cmp->flag & USER_PATHCMP_GLOB)) {
if (fnmatch(path_cmp->path, path, fnmatch_flags) == 0) {
return true;
}