diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 4a48c9a967d..e045db8fdd2 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -4457,7 +4457,19 @@ void UI_but_string_info_get(bContext *C, uiBut *but, ...) if (type == BUT_GET_LABEL) { if (but->str) { - tmp = BLI_strdup(but->str); + const char *str_sep; + size_t str_len; + + if ((but->flag & UI_BUT_HAS_SEP_CHAR) && + (str_sep = strrchr(but->str, UI_SEP_CHAR))) + { + str_len = (str_sep - but->str); + } + else { + str_len = strlen(but->str); + } + + tmp = BLI_strdupn(but->str, str_len); } else { type = BUT_GET_RNA_LABEL; /* Fail-safe solution... */ |