diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-07-14 19:42:22 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-07-14 19:57:38 +0300 |
commit | d7b9202567199cb769305d4037eefbba71dda3f9 (patch) | |
tree | 6bd69218d728e9e85762d8e3183a8431010ea349 /source/blender/blenlib/BLI_path_util.h | |
parent | d0c5eac4b7e5dc3173ee354f6f0afdd0d1e078dc (diff) |
BLI_path_utils: fix/enhance BLI_filename_make_safe(), add BLI_path_make_safe().
BLI_filename_make_safe had several issues:
* Would replace all dots ('.'), not a great idea since it would break extensions.
* Was not checking for 'control' ASCII chars (though unlikely, better to be safe here).
* Win32 only: was not checking for forbidden names (con, aux, ltp0, com0, etc.).
New BLI_path_make_safe() simply checks each path's item with BLI_filename_make_safe().
Diffstat (limited to 'source/blender/blenlib/BLI_path_util.h')
-rw-r--r-- | source/blender/blenlib/BLI_path_util.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index 63b5207f941..a344c9d2bc1 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -112,7 +112,8 @@ void BLI_cleanup_dir(const char *relabase, char *dir) ATTR_NONNULL(2); /* doesn't touch trailing slash */ void BLI_cleanup_path(const char *relabase, char *path) ATTR_NONNULL(2); -void BLI_filename_make_safe(char *fname) ATTR_NONNULL(1); +bool BLI_filename_make_safe(char *fname) ATTR_NONNULL(1); +bool BLI_path_make_safe(char *path) ATTR_NONNULL(1); /* go back one directory */ bool BLI_parent_dir(char *path) ATTR_NONNULL(); |