qb: Minor cleanup.

This uses safer quoting and removes an unneeded use of printf.

Fixes the following shellcheck warning.

In qb/qb.libs.sh line 143:
	if [ $3 ]; then
             ^-- SC2086: Double quote to prevent globbing and word splitting.

v2: Remove redundant conditional.
This commit is contained in:
orbea 2018-12-21 07:43:40 -08:00
parent b55ed9e3ce
commit 7e4723e37a
2 changed files with 3 additions and 5 deletions

View File

@ -236,9 +236,7 @@ check_val '' ALSA -lasound alsa
check_lib '' CACA -lcaca
check_lib '' SIXEL -lsixel
if [ "$HAVE_AUDIOIO" != 'no' ]; then
check_macro AUDIOIO AUDIO_SETINFO sys/audioio.h
fi
check_macro AUDIOIO AUDIO_SETINFO sys/audioio.h
if [ "$HAVE_OSS" != 'no' ]; then
check_header OSS sys/soundcard.h

View File

@ -140,9 +140,9 @@ check_header() #$1 = HAVE_$1 $2, $3, ... = header files
check_macro() #$1 = HAVE_$1 $2 = macro name $3 = header name [included only if non-empty]
{ tmpval="$(eval "printf %s \"\$HAVE_$1\"")"
[ "$tmpval" = 'no' ] && return 0
if [ $3 ]; then
if [ "${3}" ]; then
ECHOBUF="Checking presence of predefined macro $2 in $3"
header_include=$(printf '#include <%s>' "$3")
header_include="#include <$3>"
else
ECHOBUF="Checking presence of predefined macro $2"
header_include=""