From d7b9202567199cb769305d4037eefbba71dda3f9 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 14 Jul 2015 18:42:22 +0200 Subject: 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(). --- source/blender/blenlib/BLI_path_util.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/blenlib/BLI_path_util.h') 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(); -- cgit v1.2.3