Fix unexpected "/" path after normalizing empty directory path
Caused problems in the Asset Browser branch when passing an empty path. The function shouldn't blindly add a slash but sanity-check the input parameters first.
This commit is contained in:
parent
c0bd240ad0
commit
296bc35638
|
@ -264,6 +264,11 @@ void BLI_path_normalize(const char *relabase, char *path)
|
|||
*/
|
||||
void BLI_path_normalize_dir(const char *relabase, char *dir)
|
||||
{
|
||||
/* Would just create an unexpected "/" path, just early exit entirely. */
|
||||
if (dir[0] == '\0') {
|
||||
return;
|
||||
}
|
||||
|
||||
BLI_path_normalize(relabase, dir);
|
||||
BLI_path_slash_ensure(dir);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue