newt: improve input filtering

This commit is contained in:
stanley lieber 2014-04-09 01:57:03 -04:00
parent ea3c192bb5
commit 794197adb1

View file

@ -154,8 +154,10 @@ while(){
cmd=`{read}
switch($cmd){
case [0-9]*
post=$cmd(1)
printp $post
if(grep -s -e '^[0-9]+$' <{echo $cmd(1)}){
post=$cmd(1)
printp $post
}
case b
if(! ~ $post $posts(1)){
post=`{echo $post^-1 | bc}