libdraw: enter()/eenter() ^W support - we are getting there

This commit is contained in:
cinap_lenrek 2012-09-26 17:35:21 +02:00
parent d3f93ee1f3
commit 03f2668d68
2 changed files with 4 additions and 2 deletions

View file

@ -153,7 +153,8 @@ eenter(char *ask, char *buf, int len, Mouse *m)
if(k == Ketb){
while(tick > 0){
tick--;
if(tick == 0 || strchr("\t ", buf[tick-1]))
if(tick == 0 ||
strchr(" !\"#$%&'()*+,-./:;<=>?@`[\\]^{|}~", buf[tick-1]))
break;
}
buf[n = tick] = 0;

View file

@ -161,7 +161,8 @@ enter(char *ask, char *buf, int len, Mousectl *mc, Keyboardctl *kc, Screen *scr)
if(k == Ketb){
while(tick > 0){
tick--;
if(tick == 0 || strchr("\t ", buf[tick-1]))
if(tick == 0 ||
strchr(" !\"#$%&'()*+,-./:;<=>?@`[\\]^{|}~", buf[tick-1]))
break;
}
buf[n = tick] = 0;