summaryrefslogtreecommitdiff
path: root/rc/bin/newt
diff options
context:
space:
mode:
authorstanley lieber <stanley.lieber@gmail.com>2014-04-09 01:57:03 -0400
committerstanley lieber <stanley.lieber@gmail.com>2014-04-09 01:57:03 -0400
commit794197adb16da0f7644cc8b56830316682b89011 (patch)
tree8138357a32582c6d966ff48ddf3e0f7ae4136edf /rc/bin/newt
parentea3c192bb5a4abd48f895fb48e6c318c233cc16f (diff)
newt: improve input filtering
Diffstat (limited to 'rc/bin/newt')
-rwxr-xr-xrc/bin/newt6
1 files changed, 4 insertions, 2 deletions
diff --git a/rc/bin/newt b/rc/bin/newt
index 32e0b51b7..7d6e8ab8e 100755
--- a/rc/bin/newt
+++ b/rc/bin/newt
@@ -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}