aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2009-07-05 16:28:03 +0000
committerFrederic Culot <calcurse@culot.org>2009-07-05 16:28:03 +0000
commitbcd80d3dfbc1c41da33cb1c874f2439d8a2ef63b (patch)
tree5e21a00e7cf3f139a82a517cd8a1fb37d1e670aa
parent6d67689b4ffc33454f8126d5f056906d43e085b5 (diff)
downloadcalcurse-bcd80d3dfbc1c41da33cb1c874f2439d8a2ef63b.tar.gz
calcurse-bcd80d3dfbc1c41da33cb1c874f2439d8a2ef63b.zip
Fixed a bug in the line editor: characters could be erased before the beginning of the string (thanks Martin for reporting this).
-rwxr-xr-xChangeLog5
-rwxr-xr-xsrc/utils.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 851a83e..cf10eef 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-05 Frederic Culot <frederic@culot.org>
+
+ * src/utils.c (getstring): prevent character deletion before the
+ beginning of the string (thanks Martin for reporting the bug)
+
2009-06-28 Frederic Culot <frederic@culot.org>
* src/io.c (io_save_apts, io_save_conf, io_save_todo)
diff --git a/src/utils.c b/src/utils.c
index 4c492d9..b68bf23 100755
--- a/src/utils.c
+++ b/src/utils.c
@@ -1,4 +1,4 @@
-/* $calcurse: utils.c,v 1.71 2009/06/23 08:52:07 culot Exp $ */
+/* $calcurse: utils.c,v 1.72 2009/07/05 16:28:04 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -327,7 +327,7 @@ getstring (WINDOW *win, char *str, int l, int x, int y)
case 330:
case 127:
case CTRL ('H'):
- if (len > 0)
+ if (len > 0 && newpos > x)
{
--newpos;
--len;