Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_path_util.h30
-rw-r--r--source/blender/blenlib/intern/BLI_filelist.c2
-rw-r--r--source/blender/blenlib/intern/BLI_ghash.c2
-rw-r--r--source/blender/blenlib/intern/fileops.c26
-rw-r--r--source/blender/blenlib/intern/math_geom.c5
-rw-r--r--source/blender/blenlib/intern/math_vector.c2
-rw-r--r--source/blender/blenlib/intern/path_util.c89
-rw-r--r--source/blender/blenlib/intern/storage.c2
8 files changed, 81 insertions, 77 deletions
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h
index 4376aefdc25..9a6a14547d2 100644
--- a/source/blender/blenlib/BLI_path_util.h
+++ b/source/blender/blenlib/BLI_path_util.h
@@ -56,11 +56,11 @@ bool BLI_path_name_at_index(const char *__restrict path,
int *__restrict r_offset,
int *__restrict r_len) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-const char *BLI_last_slash(const char *string) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-int BLI_add_slash(char *string) ATTR_NONNULL();
-void BLI_del_slash(char *string) ATTR_NONNULL();
-const char *BLI_first_slash(const char *string) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-void BLI_path_native_slash(char *path) ATTR_NONNULL();
+const char *BLI_path_slash_rfind(const char *string) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+int BLI_path_slash_ensure(char *string) ATTR_NONNULL();
+void BLI_path_slash_rstrip(char *string) ATTR_NONNULL();
+const char *BLI_path_slash_find(const char *string) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+void BLI_path_slash_native(char *path) ATTR_NONNULL();
#ifdef _WIN32
bool BLI_path_program_extensions_add_win32(char *name, const size_t maxlen);
@@ -77,22 +77,22 @@ bool BLI_path_extension_check_glob(const char *str, const char *ext_fnmatch)
bool BLI_path_extension_glob_validate(char *ext_fnmatch) ATTR_NONNULL();
bool BLI_path_extension_replace(char *path, size_t maxlen, const char *ext) ATTR_NONNULL();
bool BLI_path_extension_ensure(char *path, size_t maxlen, const char *ext) ATTR_NONNULL();
-bool BLI_ensure_filename(char *filepath, size_t maxlen, const char *filename) ATTR_NONNULL();
-int BLI_stringdec(const char *string, char *head, char *start, unsigned short *numlen);
-void BLI_stringenc(
+bool BLI_path_filename_ensure(char *filepath, size_t maxlen, const char *filename) ATTR_NONNULL();
+int BLI_path_sequence_decode(const char *string, char *head, char *start, unsigned short *numlen);
+void BLI_path_sequence_encode(
char *string, const char *head, const char *tail, unsigned short numlen, int pic);
-void BLI_cleanup_path(const char *relabase, char *path) ATTR_NONNULL(2);
+void BLI_path_normalize(const char *relabase, char *path) ATTR_NONNULL(2);
/* Same as above but adds a trailing slash. */
-void BLI_cleanup_dir(const char *relabase, char *dir) ATTR_NONNULL(2);
+void BLI_path_normalize_dir(const char *relabase, char *dir) ATTR_NONNULL(2);
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();
+bool BLI_path_parent_dir(char *path) ATTR_NONNULL();
/* Go back until the directory is found. */
-bool BLI_parent_dir_until_exists(char *path) ATTR_NONNULL();
+bool BLI_path_parent_dir_until_exists(char *path) ATTR_NONNULL();
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL();
bool BLI_path_frame(char *path, int frame, int digits) ATTR_NONNULL();
@@ -100,7 +100,7 @@ bool BLI_path_frame_range(char *path, int sta, int end, int digits) ATTR_NONNULL
bool BLI_path_frame_get(char *path, int *r_frame, int *numdigits) ATTR_NONNULL();
void BLI_path_frame_strip(char *path, char *ext) ATTR_NONNULL();
bool BLI_path_frame_check_chars(const char *path) ATTR_NONNULL();
-bool BLI_path_cwd(char *path, const size_t maxlen) ATTR_NONNULL();
+bool BLI_path_abs_from_cwd(char *path, const size_t maxlen) ATTR_NONNULL();
void BLI_path_rel(char *file, const char *relfile) ATTR_NONNULL();
bool BLI_path_is_rel(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
@@ -109,8 +109,8 @@ bool BLI_path_is_unc(const char *path);
void BLI_path_to_display_name(char *display_name, int maxlen, const char *name) ATTR_NONNULL();
#if defined(WIN32)
-void BLI_cleanup_unc_16(wchar_t *path_16);
-void BLI_cleanup_unc(char *path_16, int maxlen);
+void BLI_path_normalize_unc_16(wchar_t *path_16);
+void BLI_path_normalize_unc(char *path_16, int maxlen);
#endif
bool BLI_path_suffix(char *string, size_t maxlen, const char *suffix, const char *sep)
diff --git a/source/blender/blenlib/intern/BLI_filelist.c b/source/blender/blenlib/intern/BLI_filelist.c
index 2e402f0c063..26f1de33aa9 100644
--- a/source/blender/blenlib/intern/BLI_filelist.c
+++ b/source/blender/blenlib/intern/BLI_filelist.c
@@ -147,7 +147,7 @@ static void bli_builddir(struct BuildDirCtx *dir_ctx, const char *dirname)
char pardir[FILE_MAXDIR];
BLI_strncpy(pardir, dirname, sizeof(pardir));
- if (BLI_parent_dir(pardir) && (BLI_access(pardir, R_OK) == 0)) {
+ if (BLI_path_parent_dir(pardir) && (BLI_access(pardir, R_OK) == 0)) {
struct dirlink *const dlink = (struct dirlink *)malloc(sizeof(struct dirlink));
if (dlink != NULL) {
dlink->name = BLI_strdup(FILENAME_PARENT);
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index 0800027e520..09dbf18acd0 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -1056,7 +1056,7 @@ void BLI_ghash_flag_clear(GHash *gh, uint flag)
* #BLI_ghash_len(gh) times before becoming done.
*
* \param gh: The GHash to iterate over.
- * \return Pointer to a new DynStr.
+ * \return Pointer to a new iterator.
*/
GHashIterator *BLI_ghashIterator_new(GHash *gh)
{
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index da77046547c..b9133edcae3 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -492,7 +492,7 @@ static bool delete_recursive(const char *dir)
/* dir listing produces dir path without trailing slash... */
BLI_strncpy(path, fl->path, sizeof(path));
- BLI_add_slash(path);
+ BLI_path_slash_ensure(path);
if (delete_recursive(path)) {
err = true;
@@ -562,9 +562,9 @@ int BLI_move(const char *file, const char *to)
BLI_strncpy(str, to, sizeof(str));
/* points 'to' to a directory ? */
- if (BLI_last_slash(str) == (str + strlen(str) - 1)) {
- if (BLI_last_slash(file) != NULL) {
- strcat(str, BLI_last_slash(file) + 1);
+ if (BLI_path_slash_rfind(str) == (str + strlen(str) - 1)) {
+ if (BLI_path_slash_rfind(file) != NULL) {
+ strcat(str, BLI_path_slash_rfind(file) + 1);
}
}
@@ -594,9 +594,9 @@ int BLI_copy(const char *file, const char *to)
BLI_strncpy(str, to, sizeof(str));
/* points 'to' to a directory ? */
- if (BLI_last_slash(str) == (str + strlen(str) - 1)) {
- if (BLI_last_slash(file) != NULL) {
- strcat(str, BLI_last_slash(file) + 1);
+ if (BLI_path_slash_rfind(str) == (str + strlen(str) - 1)) {
+ if (BLI_path_slash_rfind(file) != NULL) {
+ strcat(str, BLI_path_slash_rfind(file) + 1);
}
}
@@ -638,7 +638,7 @@ bool BLI_dir_create_recursive(const char *dirname)
* blah1/blah2 (without slash) */
BLI_strncpy(tmp, dirname, sizeof(tmp));
- BLI_del_slash(tmp);
+ BLI_path_slash_rstrip(tmp);
/* check special case "c:\foo", don't try create "c:", harmless but prints an error below */
if (isalpha(tmp[0]) && (tmp[1] == ':') && tmp[2] == '\0') {
@@ -652,7 +652,7 @@ bool BLI_dir_create_recursive(const char *dirname)
return false;
}
- lslash = (char *)BLI_last_slash(tmp);
+ lslash = (char *)BLI_path_slash_rfind(tmp);
if (lslash) {
/* Split about the last slash and recurse */
@@ -723,7 +723,7 @@ static void join_dirfile_alloc(char **dst, size_t *alloc_len, const char *dir, c
static char *strip_last_slash(const char *dir)
{
char *result = BLI_strdup(dir);
- BLI_del_slash(result);
+ BLI_path_slash_rstrip(result);
return result;
}
@@ -1277,7 +1277,7 @@ static const char *check_destination(const char *file, const char *to)
size_t len = 0;
str = strip_last_slash(file);
- filename = BLI_last_slash(str);
+ filename = BLI_path_slash_rfind(str);
if (!filename) {
MEM_freeN(str);
@@ -1350,9 +1350,9 @@ bool BLI_dir_create_recursive(const char *dirname)
BLI_strncpy(tmp, dirname, size);
/* Avoids one useless recursion in case of '/foo/bar/' path... */
- BLI_del_slash(tmp);
+ BLI_path_slash_rstrip(tmp);
- lslash = (char *)BLI_last_slash(tmp);
+ lslash = (char *)BLI_path_slash_rfind(tmp);
if (lslash) {
/* Split about the last slash and recurse */
*lslash = 0;
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index 4c0d7e08a3c..a26824bd2b5 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -2379,7 +2379,10 @@ bool isect_tri_tri_epsilon_v3(const float t_a0[3],
if (UNLIKELY(edge_fac == -1.0f)) {
/* pass */
}
- else if (edge_fac > 0.0f && edge_fac < 1.0f) {
+ /* Important to include 0.0f and 1.0f as one of the triangles vertices may be placed
+ * exactly on the plane. In this case both it's edges will have a factor of 0 or 1,
+ * but not be going through the plane. See T73566. */
+ else if (edge_fac >= 0.0f && edge_fac <= 1.0f) {
float ix_tri[3];
float span_fac;
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index 5919b7e1dd6..9009f73a62f 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -778,7 +778,7 @@ void bisect_v3_v3v3v3(float out[3], const float v1[3], const float v2[3], const
* <pre>
* v
* + ^
- * \ |
+ * \ |
* \|
* + normal: axis of reflection
* /
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 0bb2ba5859b..2f51b66725b 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -80,12 +80,12 @@ static bool BLI_path_is_abs(const char *name);
* or from dot if no digits.
* \param r_num_len: Optional to return number of digits found.
*/
-int BLI_stringdec(const char *string, char *head, char *tail, ushort *r_num_len)
+int BLI_path_sequence_decode(const char *string, char *head, char *tail, ushort *r_num_len)
{
uint nums = 0, nume = 0;
int i;
bool found_digit = false;
- const char *const lslash = BLI_last_slash(string);
+ const char *const lslash = BLI_path_slash_rfind(string);
const uint string_len = strlen(string);
const uint lslash_len = lslash != NULL ? (int)(lslash - string) : 0;
uint name_end = string_len;
@@ -151,7 +151,7 @@ int BLI_stringdec(const char *string, char *head, char *tail, ushort *r_num_len)
* Returns in area pointed to by string a string of the form "<head><pic><tail>", where pic
* is formatted as numlen digits with leading zeroes.
*/
-void BLI_stringenc(
+void BLI_path_sequence_encode(
char *string, const char *head, const char *tail, unsigned short numlen, int pic)
{
sprintf(string, "%s%.*d%s", head, numlen, MAX2(0, pic), tail);
@@ -170,7 +170,7 @@ static int BLI_path_unc_prefix_len(const char *path); /* defined below in same f
*
* \note \a path isn't protected for max string names...
*/
-void BLI_cleanup_path(const char *relabase, char *path)
+void BLI_path_normalize(const char *relabase, char *path)
{
ptrdiff_t a;
char *start, *eind;
@@ -263,10 +263,10 @@ void BLI_cleanup_path(const char *relabase, char *path)
/**
* Cleanup filepath ensuring a trailing slash.
*/
-void BLI_cleanup_dir(const char *relabase, char *dir)
+void BLI_path_normalize_dir(const char *relabase, char *dir)
{
- BLI_cleanup_path(relabase, dir);
- BLI_add_slash(dir);
+ BLI_path_normalize(relabase, dir);
+ BLI_path_slash_ensure(dir);
}
/**
@@ -381,8 +381,8 @@ bool BLI_path_make_safe(char *path)
}
#endif
- for (curr_slash = (char *)BLI_first_slash(curr_path); curr_slash;
- curr_slash = (char *)BLI_first_slash(curr_path)) {
+ for (curr_slash = (char *)BLI_path_slash_find(curr_path); curr_slash;
+ curr_slash = (char *)BLI_path_slash_find(curr_path)) {
const char backup = *curr_slash;
*curr_slash = '\0';
if (!skip_first && (*curr_path != '\0') && BLI_filename_make_safe(curr_path)) {
@@ -494,14 +494,14 @@ static void BLI_path_unc_to_short(wchar_t *unc)
}
}
-void BLI_cleanup_unc(char *path, int maxlen)
+void BLI_path_normalize_unc(char *path, int maxlen)
{
wchar_t *tmp_16 = alloc_utf16_from_8(path, 1);
- BLI_cleanup_unc_16(tmp_16);
+ BLI_path_normalize_unc_16(tmp_16);
conv_utf_16_to_8(tmp_16, path, maxlen);
}
-void BLI_cleanup_unc_16(wchar_t *path_16)
+void BLI_path_normalize_unc_16(wchar_t *path_16)
{
BLI_path_unc_to_short(path_16);
BLI_path_add_slash_to_share(path_16);
@@ -578,11 +578,11 @@ void BLI_path_rel(char *file, const char *relfile)
BLI_str_replace_char(file + BLI_path_unc_prefix_len(file), '\\', '/');
/* remove /./ which confuse the following slash counting... */
- BLI_cleanup_path(NULL, file);
- BLI_cleanup_path(NULL, temp);
+ BLI_path_normalize(NULL, file);
+ BLI_path_normalize(NULL, temp);
/* the last slash in the file indicates where the path part ends */
- lslash = BLI_last_slash(temp);
+ lslash = BLI_path_slash_rfind(temp);
if (lslash) {
/* find the prefix of the filename that is equal for both filenames.
@@ -701,13 +701,13 @@ bool BLI_path_suffix(char *string, size_t maxlen, const char *suffix, const char
* Replaces path with the path of its parent directory, returning true if
* it was able to find a parent directory within the pathname.
*/
-bool BLI_parent_dir(char *path)
+bool BLI_path_parent_dir(char *path)
{
const char parent_dir[] = {'.', '.', SEP, '\0'}; /* "../" or "..\\" */
char tmp[FILE_MAX + 4];
BLI_join_dirfile(tmp, sizeof(tmp), path, parent_dir);
- BLI_cleanup_path(NULL, tmp); /* does all the work of normalizing the path for us */
+ BLI_path_normalize(NULL, tmp); /* does all the work of normalizing the path for us */
if (!BLI_path_extension_check(tmp, parent_dir)) {
strcpy(path, tmp); /* We assume pardir is always shorter... */
@@ -722,12 +722,12 @@ bool BLI_parent_dir(char *path)
* Strips off nonexistent (or non-accessible) subdirectories from the end of *dir,
* leaving the path of the lowest-level directory that does exist and we can read.
*/
-bool BLI_parent_dir_until_exists(char *dir)
+bool BLI_path_parent_dir_until_exists(char *dir)
{
bool valid_path = true;
/* Loop as long as cur path is not a dir, and we can get a parent path. */
- while ((BLI_access(dir, R_OK) != 0) && (valid_path = BLI_parent_dir(dir))) {
+ while ((BLI_access(dir, R_OK) != 0) && (valid_path = BLI_path_parent_dir(dir))) {
/* pass */
}
return (valid_path && dir[0]);
@@ -777,7 +777,7 @@ static bool stringframe_chars(const char *path, int *char_start, int *char_end)
*/
static void ensure_digits(char *path, int digits)
{
- char *file = (char *)BLI_last_slash(path);
+ char *file = (char *)BLI_path_slash_rfind(path);
if (file == NULL) {
file = path;
@@ -852,7 +852,7 @@ bool BLI_path_frame_range(char *path, int sta, int end, int digits)
bool BLI_path_frame_get(char *path, int *r_frame, int *r_numdigits)
{
if (*path) {
- char *file = (char *)BLI_last_slash(path);
+ char *file = (char *)BLI_path_slash_rfind(path);
char *c;
int len, numdigits;
@@ -908,7 +908,7 @@ void BLI_path_frame_strip(char *path, char *r_ext)
return;
}
- char *file = (char *)BLI_last_slash(path);
+ char *file = (char *)BLI_path_slash_rfind(path);
char *c, *suffix;
int len;
int numdigits = 0;
@@ -1075,8 +1075,8 @@ bool BLI_path_abs(char *path, const char *basepath)
BLI_strncpy(base, basepath, sizeof(base));
/* file component is ignored, so don't bother with the trailing slash */
- BLI_cleanup_path(NULL, base);
- lslash = BLI_last_slash(base);
+ BLI_path_normalize(NULL, base);
+ lslash = BLI_path_slash_rfind(base);
BLI_str_replace_char(base + BLI_path_unc_prefix_len(base), '\\', '/');
if (lslash) {
@@ -1110,19 +1110,20 @@ bool BLI_path_abs(char *path, const char *basepath)
#endif
/* ensure this is after correcting for path switch */
- BLI_cleanup_path(NULL, path);
+ BLI_path_normalize(NULL, path);
return wasrelative;
}
/**
- * Expands path relative to the current working directory, if it was relative.
- * Returns true if such expansion was done.
+ * Checks for relative path, expanding them relative to the current working directory.
+ * Returns true if the expansion was performed.
*
- * \note Should only be done with command line paths.
- * this is _not_ something blenders internal paths support like the "//" prefix
+ * \note Should only be called with command line paths.
+ * This is _not_ something Blender's internal paths support, instead they use the "//" prefix.
+ * In most cases #BLI_path_abs should be used instead.
*/
-bool BLI_path_cwd(char *path, const size_t maxlen)
+bool BLI_path_abs_from_cwd(char *path, const size_t maxlen)
{
#ifdef DEBUG_STRSIZE
memset(path, 0xff, sizeof(*path) * maxlen);
@@ -1363,7 +1364,7 @@ void BLI_make_file_string(const char *relabase, char *string, const char *dir, c
/* Get the file name, chop everything past the last slash (ie. the filename) */
strcpy(string, relabase);
- lslash = (char *)BLI_last_slash(string);
+ lslash = (char *)BLI_path_slash_rfind(string);
if (lslash) {
*(lslash + 1) = 0;
}
@@ -1418,7 +1419,7 @@ void BLI_make_file_string(const char *relabase, char *string, const char *dir, c
strcat(string, file);
/* Push all slashes to the system preferred direction */
- BLI_path_native_slash(string);
+ BLI_path_slash_native(string);
}
static bool path_extension_check_ex(const char *str,
@@ -1608,12 +1609,12 @@ bool BLI_path_extension_ensure(char *path, size_t maxlen, const char *ext)
return true;
}
-bool BLI_ensure_filename(char *filepath, size_t maxlen, const char *filename)
+bool BLI_path_filename_ensure(char *filepath, size_t maxlen, const char *filename)
{
#ifdef DEBUG_STRSIZE
memset(filepath, 0xff, sizeof(*filepath) * maxlen);
#endif
- char *c = (char *)BLI_last_slash(filepath);
+ char *c = (char *)BLI_path_slash_rfind(filepath);
if (!c || ((c - filepath) < maxlen - (strlen(filename) + 1))) {
strcpy(c ? &c[1] : filepath, filename);
return true;
@@ -1636,7 +1637,7 @@ void BLI_split_dirfile(
memset(dir, 0xff, sizeof(*dir) * dirlen);
memset(file, 0xff, sizeof(*file) * filelen);
#endif
- const char *lslash_str = BLI_last_slash(string);
+ const char *lslash_str = BLI_path_slash_rfind(string);
const size_t lslash = lslash_str ? (size_t)(lslash_str - string) + 1 : 0;
if (dir) {
@@ -1680,7 +1681,7 @@ const char *BLI_path_extension(const char *filepath)
if (extension == NULL) {
return NULL;
}
- if (BLI_first_slash(extension) != NULL) {
+ if (BLI_path_slash_find(extension) != NULL) {
/* There is a path separator in the extension, so the '.' was found in a
* directory component and not in the filename. */
return NULL;
@@ -1695,7 +1696,7 @@ void BLI_path_append(char *__restrict dst, const size_t maxlen, const char *__re
{
size_t dirlen = BLI_strnlen(dst, maxlen);
- /* inline BLI_add_slash */
+ /* inline BLI_path_slash_ensure */
if ((dirlen > 0) && (dst[dirlen - 1] != SEP)) {
dst[dirlen++] = SEP;
dst[dirlen] = '\0';
@@ -1738,7 +1739,7 @@ void BLI_join_dirfile(char *__restrict dst,
return; /* fills the path */
}
- /* inline BLI_add_slash */
+ /* inline BLI_path_slash_ensure */
if ((dirlen > 0) && !ELEM(dst[dirlen - 1], SEP, ALTSEP)) {
dst[dirlen++] = SEP;
dst[dirlen] = '\0';
@@ -1846,7 +1847,7 @@ size_t BLI_path_join(char *__restrict dst, const size_t dst_len, const char *pat
*/
const char *BLI_path_basename(const char *path)
{
- const char *const filename = BLI_last_slash(path);
+ const char *const filename = BLI_path_slash_rfind(path);
return filename ? filename + 1 : path;
}
@@ -1921,7 +1922,7 @@ bool BLI_path_name_at_index(const char *__restrict path,
/**
* Returns pointer to the leftmost path separator in string. Not actually used anywhere.
*/
-const char *BLI_first_slash(const char *string)
+const char *BLI_path_slash_find(const char *string)
{
const char *const ffslash = strchr(string, '/');
const char *const fbslash = strchr(string, '\\');
@@ -1939,7 +1940,7 @@ const char *BLI_first_slash(const char *string)
/**
* Returns pointer to the rightmost path separator in string.
*/
-const char *BLI_last_slash(const char *string)
+const char *BLI_path_slash_rfind(const char *string)
{
const char *const lfslash = strrchr(string, '/');
const char *const lbslash = strrchr(string, '\\');
@@ -1958,7 +1959,7 @@ const char *BLI_last_slash(const char *string)
* Appends a slash to string if there isn't one there already.
* Returns the new length of the string.
*/
-int BLI_add_slash(char *string)
+int BLI_path_slash_ensure(char *string)
{
int len = strlen(string);
if (len == 0 || string[len - 1] != SEP) {
@@ -1972,7 +1973,7 @@ int BLI_add_slash(char *string)
/**
* Removes the last slash and everything after it to the end of string, if there is one.
*/
-void BLI_del_slash(char *string)
+void BLI_path_slash_rstrip(char *string)
{
int len = strlen(string);
while (len) {
@@ -1989,7 +1990,7 @@ void BLI_del_slash(char *string)
/**
* Changes to the path separators to the native ones for this OS.
*/
-void BLI_path_native_slash(char *path)
+void BLI_path_slash_native(char *path)
{
#ifdef WIN32
if (path && BLI_strnlen(path, 3) > 2) {
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 7274a15661a..9b437b02c0a 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -316,7 +316,7 @@ int BLI_exists(const char *name)
* 2. after the C:\ when the path is the volume only
*/
if ((len >= 3) && (tmp_16[0] == L'\\') && (tmp_16[1] == L'\\')) {
- BLI_cleanup_unc_16(tmp_16);
+ BLI_path_normalize_unc_16(tmp_16);
}
if ((tmp_16[1] == L':') && (tmp_16[2] == L'\0')) {