diff options
author | Andrea Weikert <elubie@gmx.net> | 2008-04-30 01:43:17 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2008-04-30 01:43:17 +0400 |
commit | b1d841f2c43430f817e04a0b1f57dda2109021e6 (patch) | |
tree | 90e6b0695c4c884b9b9e3336c526b1bd12f9e2e0 /source/blender/blenlib | |
parent | 4be6ef57587d5a40fdfd205a10187788a70c5ba8 (diff) |
== bugfix ==
fix for [#6580] invalid file names not handled consistently when saving
only affects windows, where invisible file stream could be created if filename contains ':'
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_winstuff.h | 3 | ||||
-rw-r--r-- | source/blender/blenlib/intern/winstuff.c | 21 |
2 files changed, 23 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h index 54d70626dd5..9c192ba8b09 100644 --- a/source/blender/blenlib/BLI_winstuff.h +++ b/source/blender/blenlib/BLI_winstuff.h @@ -110,7 +110,8 @@ void RegisterBlendExtension(char * str); DIR *opendir (const char *path); struct dirent *readdir(DIR *dp); int closedir (DIR *dp); -void get_default_root(char* root); +void get_default_root(char *root); +int check_file_chars(char *filename); #endif /* __WINSTUFF_H__ */ diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index ace677e6045..666a54b54cc 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -196,6 +196,27 @@ void get_default_root(char* root) { } } +int check_file_chars(char *filename) +{ + char *p = filename; + while (*p) { + switch (*p) { + case ':': + case '?': + case '*': + case '|': + case '\\': + case '/': + case '\"': + return 0; + break; + } + + p++; + } + return 1; +} + #else static void BLI_WINSTUFF_C_IS_EMPTY_FOR_UNIX(void) |