[gnome-calculator] Fix crash pressing super/subscript buttons when equation has trailing whitespace



commit 30539a13dbc498f8b89748504bce652c31765d61
Author: Robert Ancell <robert ancell canonical com>
Date:   Fri May 9 15:04:18 2014 +1200

    Fix crash pressing super/subscript buttons when equation has trailing whitespace

 src/math-buttons.vala |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/math-buttons.vala b/src/math-buttons.vala
index 1f70819..e0d5bf9 100644
--- a/src/math-buttons.vala
+++ b/src/math-buttons.vala
@@ -941,9 +941,12 @@ public class MathButtons : Gtk.Box
         while (start.backward_char ())
         {
             if (!start.get_char ().isspace ())
+            {
+                start.forward_char ();
                 break;
-            equation.delete (ref start, ref end);
+            }
         }
+        equation.delete (ref start, ref end);
     }
 
     private void set_superscript_cb (Gtk.Button widget)


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