newt: improve input filtering
This commit is contained in:
parent
ea3c192bb5
commit
794197adb1
1 changed files with 4 additions and 2 deletions
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue