[PATCH] weston-editor: Don't copy the preedit string before inserting it

Silvan Jegen s.jegen at gmail.com
Thu Nov 17 20:43:05 UTC 2016


Signed-off-by: Silvan Jegen <s.jegen at gmail.com>
---
 clients/editor.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/clients/editor.c b/clients/editor.c
index 6805d8a..1ed3eec 100644
--- a/clients/editor.c
+++ b/clients/editor.c
@@ -944,16 +944,10 @@ text_entry_reset_preedit(struct text_entry *entry)
 static void
 text_entry_commit_and_reset(struct text_entry *entry)
 {
-	char *commit = NULL;
-
 	if (entry->preedit.commit)
-		commit = strdup(entry->preedit.commit);
+		text_entry_insert_at_cursor(entry, entry->preedit.commit, 0, 0);
 
 	text_entry_reset_preedit(entry);
-	if (commit) {
-		text_entry_insert_at_cursor(entry, commit, 0, 0);
-		free(commit);
-	}
 
 	zwp_text_input_v1_reset(entry->text_input);
 	text_entry_update(entry);
-- 
2.10.2



More information about the wayland-devel mailing list