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}
|
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}
|
||||||
|
|
Loading…
Reference in a new issue