Fix T88908: Incorrect path handling in adding strips
When image strip is added from python using `image_strip_add` operator and directory path is not terminated with slash, last part of directory was ignored. Use `BLI_join_dirfile` instead of simple string concatenation.
This commit is contained in:
parent
efe90944ee
commit
7cd91a06eb
Notes:
blender-bot
2023-02-14 03:46:57 +01:00
Referenced by issue #88908, VSE, Python: bpy.ops.sequencer.image_strip_add() will truncate the directory name if the 'directory' variable does not end with a path separator
|
@ -260,7 +260,7 @@ static void load_data_init_from_operator(SeqLoadData *load_data, bContext *C, wm
|
|||
RNA_PROP_BEGIN (op->ptr, itemptr, prop) {
|
||||
char *filename = RNA_string_get_alloc(&itemptr, "name", NULL, 0);
|
||||
BLI_strncpy(load_data->name, filename, sizeof(load_data->name));
|
||||
BLI_snprintf(load_data->path, sizeof(load_data->path), "%s%s", directory, filename);
|
||||
BLI_join_dirfile(load_data->path, sizeof(load_data->path), directory, filename);
|
||||
MEM_freeN(filename);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue