adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[adonthell-commits] master 491109b: FIXED segfault on Haiku when removin


From: Kai Sterker
Subject: [adonthell-commits] master 491109b: FIXED segfault on Haiku when removing more than 1 character at a time
Date: Wed, 19 Oct 2016 18:43:05 +0000 (UTC)

branch: master
commit 491109b06e485921bc57872a0dcf2cbba6632338
Author: Kai Sterker <address@hidden>
Commit: Kai Sterker <address@hidden>

    FIXED segfault on Haiku when removing more than 1 character at a time
---
 src/label_input.cc |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/label_input.cc b/src/label_input.cc
index 692d622..18ec9bf 100644
--- a/src/label_input.cc
+++ b/src/label_input.cc
@@ -69,8 +69,15 @@ bool label_input::input_update()
             my_cursor_.idx -= count;
             u_int16 idx = my_cursor_.idx;
             u_int16 glyph = ucd (idx);
+#ifndef __HAIKU__
             my_text_.erase (my_cursor_.idx, count);
-
+#else
+            while(count > 0)
+            {
+                my_text_.erase (my_cursor_.idx, 1);
+                count--;
+            }
+#endif
             update_cursor ();
             my_old_cursor_ = my_cursor_; 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]