aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Obergrusberger <tradiaz@yahoo.de>2007-08-26 19:28:30 +0000
committerAndreas Obergrusberger <tradiaz@yahoo.de>2007-08-26 19:28:30 +0000
commit6e3f91f094c0c95036e11a4f070494ab850c3a6d (patch)
tree8551e751378a3d12172a26a51d93c0dbd234f683
parent2d1cbdd3535af0e660129ad3af3121c595e8c3a8 (diff)
downloadmpd-6e3f91f094c0c95036e11a4f070494ab850c3a6d.tar.gz
mpd-6e3f91f094c0c95036e11a4f070494ab850c3a6d.tar.xz
mpd-6e3f91f094c0c95036e11a4f070494ab850c3a6d.zip
fixed 0001496
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@6817 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--src/wreadln.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/wreadln.c b/src/wreadln.c
index 8694bb367..fd653329b 100644
--- a/src/wreadln.c
+++ b/src/wreadln.c
@@ -38,6 +38,7 @@
#define KEY_CTRL_E 5
#define KEY_CTRL_G 7
#define KEY_CTRL_K 11
+#define KEY_CTRL_U 21
#define KEY_CTRL_Z 26
#define KEY_BCKSPC 8
#define TAB 9
@@ -279,6 +280,12 @@ _wreadln(WINDOW *w,
case KEY_CTRL_K:
line[cursor] = 0;
break;
+ case KEY_CTRL_U:
+ cursor = my_strlen(line);
+ for (i = 0;i < cursor; i++)
+ line[i] = '\0';
+ cursor = 0;
+ break;
case 127:
case KEY_BCKSPC: /* handle backspace: copy all */
case KEY_BACKSPACE: /* chars starting from curpos */
@@ -702,6 +709,12 @@ _wreadln(WINDOW *w,
case KEY_CTRL_K:
wline[cursor] = 0;
break;
+ case KEY_CTRL_U:
+ cursor = wcslen(wline);
+ for (i = 0;i < cursor; i++)
+ wline[i] = '\0';
+ cursor = 0;
+ break;
case KEY_CTRL_Z:
sigstop();
break;