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} cmd=`{read}
switch($cmd){ switch($cmd){
case [0-9]* case [0-9]*
post=$cmd(1) if(grep -s -e '^[0-9]+$' <{echo $cmd(1)}){
printp $post post=$cmd(1)
printp $post
}
case b case b
if(! ~ $post $posts(1)){ if(! ~ $post $posts(1)){
post=`{echo $post^-1 | bc} post=`{echo $post^-1 | bc}