diff mbox

aubdump: Fix intel_aubdump -o <filename>

Message ID 20161123235333.32296-1-kenneth@whitecape.org (mailing list archive)
State New, archived
Headers show

Commit Message

Kenneth Graunke Nov. 23, 2016, 11:53 p.m. UTC
This looks like a mistake in 1f43677f895a88ae880b35f9b18cc7e6869d0ca6.
---
 tools/intel_aubdump.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

This code still looks really weird.  ${foo:bar} means "the value of $foo,
unless it's unset/empty, in which case 'bar'.  But if $file is empty...
then we process $file?  Maybe I'm not reading it right.
diff mbox

Patch

diff --git a/tools/intel_aubdump.in b/tools/intel_aubdump.in
index 343dc29..977fe95 100644
--- a/tools/intel_aubdump.in
+++ b/tools/intel_aubdump.in
@@ -36,31 +36,31 @@  function add_arg() {
 function build_command () {
       command=""
       for i in $1; do
 	  if [ -z $command ]; then
 	      command=$i
 	  else
 	      command="$command,$i"
 	  fi;
       done
 }
 
 while true; do
       case "$1" in
 	  -o)
 	      file=$2
-	      add_arg "file=${f:-$(basename ${f}).aub}"
+	      add_arg "file=${file:-$(basename ${file}).aub}"
 	      shift 2
 	      ;;
 	  -v)
 	      add_arg "verbose=1"
 	      shift 1
 	      ;;
 	  -o*)
 	      file=${1##-o}
 	      add_arg "file=${file:-$(basename ${file}).aub}"
 	      shift
 	      ;;
 	  --output=*)
 	      file=${1##--output=}
 	      add_arg "file=${file:-$(basename ${file}).aub}"
 	      shift