BLI_path: use module prefix for BLI_filename_make_safe
Rename BLI_filename_make_safe -> BLI_path_make_safe_filename.
This commit is contained in:
@@ -517,7 +517,7 @@ static void unpack_generate_paths(const char *name,
|
||||
}
|
||||
}
|
||||
|
||||
BLI_filename_make_safe(tempname);
|
||||
BLI_path_make_safe_filename(tempname);
|
||||
printf("%s\n", tempname);
|
||||
}
|
||||
|
||||
|
||||
@@ -385,8 +385,8 @@ void BLI_path_normalize_dir(char *dir, size_t dir_maxlen) ATTR_NONNULL(1);
|
||||
* \note On Windows, it also checks for forbidden names
|
||||
* (see https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx ).
|
||||
*/
|
||||
bool BLI_filename_make_safe_ex(char *fname, bool allow_tokens) ATTR_NONNULL(1);
|
||||
bool BLI_filename_make_safe(char *fname) ATTR_NONNULL(1);
|
||||
bool BLI_path_make_safe_filename_ex(char *fname, bool allow_tokens) ATTR_NONNULL(1);
|
||||
bool BLI_path_make_safe_filename(char *fname) ATTR_NONNULL(1);
|
||||
|
||||
/**
|
||||
* Make given path OS-safe.
|
||||
|
||||
@@ -365,7 +365,7 @@ void BLI_path_normalize_dir(char *dir, size_t dir_maxlen)
|
||||
BLI_path_slash_ensure(dir, dir_maxlen);
|
||||
}
|
||||
|
||||
bool BLI_filename_make_safe_ex(char *fname, bool allow_tokens)
|
||||
bool BLI_path_make_safe_filename_ex(char *fname, bool allow_tokens)
|
||||
{
|
||||
#define INVALID_CHARS \
|
||||
"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" \
|
||||
@@ -441,14 +441,14 @@ bool BLI_filename_make_safe_ex(char *fname, bool allow_tokens)
|
||||
return changed;
|
||||
}
|
||||
|
||||
bool BLI_filename_make_safe(char *fname)
|
||||
bool BLI_path_make_safe_filename(char *fname)
|
||||
{
|
||||
return BLI_filename_make_safe_ex(fname, false);
|
||||
return BLI_path_make_safe_filename_ex(fname, false);
|
||||
}
|
||||
|
||||
bool BLI_path_make_safe(char *path)
|
||||
{
|
||||
/* Simply apply #BLI_filename_make_safe() over each component of the path.
|
||||
/* Simply apply #BLI_path_make_safe_filename() over each component of the path.
|
||||
* Luckily enough, same *safe* rules applies to file & directory names. */
|
||||
char *curr_slash, *curr_path = path;
|
||||
bool changed = false;
|
||||
@@ -466,14 +466,14 @@ bool BLI_path_make_safe(char *path)
|
||||
{
|
||||
const char backup = *curr_slash;
|
||||
*curr_slash = '\0';
|
||||
if (!skip_first && (*curr_path != '\0') && BLI_filename_make_safe(curr_path)) {
|
||||
if (!skip_first && (*curr_path != '\0') && BLI_path_make_safe_filename(curr_path)) {
|
||||
changed = true;
|
||||
}
|
||||
skip_first = false;
|
||||
curr_path = curr_slash + 1;
|
||||
*curr_slash = backup;
|
||||
}
|
||||
if (BLI_filename_make_safe(curr_path)) {
|
||||
if (BLI_path_make_safe_filename(curr_path)) {
|
||||
changed = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -600,7 +600,7 @@ static void renamebutton_cb(bContext *C, void * /*arg1*/, char *oldname)
|
||||
|
||||
BLI_path_join(orgname, sizeof(orgname), params->dir, oldname);
|
||||
BLI_strncpy(filename, params->renamefile, sizeof(filename));
|
||||
BLI_filename_make_safe(filename);
|
||||
BLI_path_make_safe_filename(filename);
|
||||
BLI_path_join(newname, sizeof(newname), params->dir, filename);
|
||||
|
||||
if (!STREQ(orgname, newname)) {
|
||||
|
||||
@@ -2895,7 +2895,7 @@ void file_filename_enter_handle(bContext *C, void *UNUSED(arg_unused), void *arg
|
||||
|
||||
/* *After* file_select_match! */
|
||||
const bool allow_tokens = (params->flag & FILE_PATH_TOKENS_ALLOW) != 0;
|
||||
BLI_filename_make_safe_ex(params->file, allow_tokens);
|
||||
BLI_path_make_safe_filename_ex(params->file, allow_tokens);
|
||||
|
||||
if (matches) {
|
||||
/* replace the pattern (or filename that the user typed in,
|
||||
|
||||
@@ -310,7 +310,7 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P
|
||||
}
|
||||
|
||||
if (use_new_name) {
|
||||
BLI_filename_make_safe(cache->name);
|
||||
BLI_path_make_safe_filename(cache->name);
|
||||
|
||||
if (pid2 && cache->flag & PTCACHE_DISK_CACHE) {
|
||||
char old_name[80];
|
||||
|
||||
@@ -307,8 +307,8 @@ static void seq_disk_cache_get_dir(
|
||||
BLI_snprintf(
|
||||
scene_name, sizeof(scene_name), "%s-%" PRId64, scene->id.name, disk_cache->timestamp);
|
||||
BLI_strncpy(seq_name, seq->name, sizeof(seq_name));
|
||||
BLI_filename_make_safe(scene_name);
|
||||
BLI_filename_make_safe(seq_name);
|
||||
BLI_path_make_safe_filename(scene_name);
|
||||
BLI_path_make_safe_filename(seq_name);
|
||||
|
||||
BLI_path_join(path, path_len, project_dir, scene_name, seq_name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user