diff options
author | Campbell Barton <campbell@blender.org> | 2022-10-30 07:24:41 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-10-30 07:24:41 +0300 |
commit | 5d77c3a6a5a27094342d942c5eb4db3c8ded1cd1 (patch) | |
tree | 329684c0201fced95d10f15fdb2457036ad9568b /source/blender | |
parent | d1d2f002c7caaf4ab457ec27bbc44666d7aac624 (diff) |
Fix T102132: Directory selection fails to add trailing slash
Regression in [0], accessing the path from the file selector relied on
BLI_join_dirfile adding a trailing "/" when the filename was empty.
[0]: 9f6a045e23cf4ab132ef78eeaf070bd53d0c509f
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index a4d4bf98474..20025b0bac9 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1564,7 +1564,13 @@ void file_sfile_to_operator_ex( PropertyRNA *prop; /* XXX, not real length */ - BLI_path_join(filepath, FILE_MAX, params->dir, params->file); + if (params->file[0]) { + BLI_path_join(filepath, FILE_MAX, params->dir, params->file); + } + else { + BLI_strncpy(filepath, params->dir, FILE_MAX - 1); + BLI_path_slash_ensure(filepath); + } if ((prop = RNA_struct_find_property(op->ptr, "relative_path"))) { if (RNA_property_boolean_get(op->ptr, prop)) { |