[Bf-blender-cvs] [7d2b4ae9c6e] master: Fix menu operator/search clipping the last character

Campbell Barton noreply at git.blender.org
Tue Jun 9 11:26:36 CEST 2020


Commit: 7d2b4ae9c6ecce394130cd08694914bf93497a11
Author: Campbell Barton
Date:   Tue Jun 9 19:23:17 2020 +1000
Branches: master
https://developer.blender.org/rB7d2b4ae9c6ecce394130cd08694914bf93497a11

Fix menu operator/search clipping the last character

Noted in T77504

===================================================================

M	source/blender/editors/interface/interface_region_search.c

===================================================================

diff --git a/source/blender/editors/interface/interface_region_search.c b/source/blender/editors/interface/interface_region_search.c
index 0007f6ab9a2..34bbb644ef7 100644
--- a/source/blender/editors/interface/interface_region_search.c
+++ b/source/blender/editors/interface/interface_region_search.c
@@ -279,7 +279,7 @@ bool ui_searchbox_apply(uiBut *but, ARegion *region)
     const char *name = data->items.names[data->active];
     const char *name_sep = data->use_sep ? strrchr(name, UI_SEP_CHAR) : NULL;
 
-    BLI_strncpy(but->editstr, name, name_sep ? (name_sep - name) : data->items.maxstrlen);
+    BLI_strncpy(but->editstr, name, name_sep ? (name_sep - name) + 1 : data->items.maxstrlen);
 
     but->func_arg2 = data->items.pointers[data->active];



More information about the Bf-blender-cvs mailing list