Refactor: change light linking object storage be dynamically allocated #108090
|
@ -350,8 +350,8 @@ static int path_normalize_impl(char *path, bool check_blend_relative_prefix)
|
|||
* as these directories are expected to be skipped. */
|
||||
BLI_assert(!IS_PARENT_DIR(start));
|
||||
const size_t start_len = path_len - (start - path);
|
||||
memmove(path_first_non_slash_part, start, start_len + 1);
|
||||
BLI_assert(strlen(start) == start_len);
|
||||
memmove(path_first_non_slash_part, start, start_len + 1);
|
||||
path_len -= start - path_first_non_slash_part;
|
||||
BLI_assert(strlen(path) == path_len);
|
||||
}
|
||||
|
|
|
@ -117,6 +117,10 @@ TEST(path_util, Normalize_UnbalancedAbsolute)
|
|||
NORMALIZE("/a/b/c/../../../../../d", "/d");
|
||||
NORMALIZE("/a/b/c/../../../../d", "/d");
|
||||
NORMALIZE("/a/b/c/../../../d", "/d");
|
||||
|
||||
/* Use a longer path as it may hit corner cases. */
|
||||
NORMALIZE("/home/username/Downloads/../../../../../Users/Example/Desktop/test.jpg",
|
||||
"/Users/Example/Desktop/test.jpg");
|
||||
}
|
||||
|
||||
/* #BLI_path_normalize: with relative paths that result in leading "../". */
|
||||
|
|
Loading…
Reference in New Issue