From 2bebb2f2a1ba4395683db310649196eb26e82aba Mon Sep 17 00:00:00 2001 From: drowe67 Date: Sun, 18 Mar 2012 20:58:47 +0000 Subject: [PATCH] robustness patch from thomas git-svn-id: https://svn.code.sf.net/p/freetel/code@347 01035d8c-6547-0410-b346-abe4f91aad63 --- codec2-dev/script/menu.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codec2-dev/script/menu.sh b/codec2-dev/script/menu.sh index 7f586ca1..386a39e7 100755 --- a/codec2-dev/script/menu.sh +++ b/codec2-dev/script/menu.sh @@ -58,9 +58,13 @@ while true ; do readchar=`dd bs=1 count=1 2>/dev/null` stty -cbreak if [ -n "$readchar" ] ; then - if [ $readchar == 'q' -o $readchar == 'Q' ] ; then + if [ x$readchar == 'xq' -o x$readchar == 'xQ' ] ; then exit 0 fi + if [ -z ${file[$readchar]} ] ; then + echo -n -e "\nUnknown input\n" $items"- " + continue + fi if ( play --version ) >/dev/null 2>&1; then play -r 8000 -s -2 ${file[$readchar]} $dsp 2> /dev/null elif ( aplay --version ) > /dev/null 2>&1; then -- 2.25.1