aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2007-02-28 21:29:05 +0000
committerFrederic Culot <calcurse@culot.org>2007-02-28 21:29:05 +0000
commit0352ae31073a8870e8bd4d2cb031c4caa4ceced8 (patch)
treed8a262d762b409bfb2c4c4ade438fd7faf0791f3 /src/utils.c
parented40b1f038503f6b84c35ce6098578da0cacd59f (diff)
downloadcalcurse-0352ae31073a8870e8bd4d2cb031c4caa4ceced8.tar.gz
calcurse-0352ae31073a8870e8bd4d2cb031c4caa4ceced8.zip
bugfix: CTRL-D problems while editing item fixed. Thanks Toucouch for reporting it.
Diffstat (limited to 'src/utils.c')
-rwxr-xr-xsrc/utils.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/utils.c b/src/utils.c
index d475b8f..078b302 100755
--- a/src/utils.c
+++ b/src/utils.c
@@ -1,4 +1,4 @@
-/* $calcurse: utils.c,v 1.21 2007/01/16 07:55:18 culot Exp $ */
+/* $calcurse: utils.c,v 1.22 2007/02/28 21:29:05 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -216,8 +216,14 @@ int getstring(WINDOW *win, int colr, char *str, int l, int x, int y)
break;
case CTRL('D'): /* delete next character */
- --len;
- del_char(newpos, orig);
+ if (newpos != (x + len)) {
+ --len;
+ if (newpos >= x + len)
+ --str;
+ else
+ del_char(newpos, orig);
+ } else
+ printf("\a");
break;
case CTRL('K'): /* delete to end-of-line */