The previous commit added quotes around some variables and that
caused empty string arguments when variables are unset. Use
conditional expansion to only quote when variables are set.
I see something like this
$ kchecker --spammy net/ethtool/ioctl.c
make: *** empty string invalid as file name. Stop.
Fixes: 9b3323efbe7f ("kchecker: Add quotes around variables")
Signed-off-by: Harshit Mogalapalli <[email protected]>
---
I have tested it on mine with no variables set, worth testing it when
some of these varaibles are set as well.
---
smatch_scripts/kchecker | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/smatch_scripts/kchecker b/smatch_scripts/kchecker
index 782c3717b2a7..90e3507cc10f 100755
--- a/smatch_scripts/kchecker
+++ b/smatch_scripts/kchecker
@@ -82,4 +82,4 @@ if [[ ! -z $O ]] ; then
KERNEL_O="O=$O"
fi
-make "$KERNEL_CROSS_COMPILE" "$KERNEL_ARCH" "$KERNEL_O" C=2 "$ENDIAN"
CHECK="$PRE $CMD $POST" $oname
+make ${KERNEL_CROSS_COMPILE:+"$KERNEL_CROSS_COMPILE"}
${KERNEL_ARCH:+"$KERNEL_ARCH"} ${KERNEL_O:+"$KERNEL_O"} C=2
${ENDIAN:+"$ENDIAN"} CHECK="$PRE $CMD $POST" $oname
--
2.47.3