ref: 794197adb16da0f7644cc8b56830316682b89011
parent: ea3c192bb5a4abd48f895fb48e6c318c233cc16f
author: stanley lieber <stanley.lieber@gmail.com>
date: Tue Apr 8 21:57:03 EDT 2014
newt: improve input filtering
--- a/rc/bin/newt
+++ b/rc/bin/newt
@@ -154,8 +154,10 @@
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}