From 4550d2f15b3a7ce2451c1f29500b9339430c877f Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 24 May 2021 08:00:00 +0000 Subject: [PATCH] config.guess: fix shellcheck warning SC2154 While, according to Plan 9 documentation, the environment variable $cputype is set to the name of the kernel's CPU's architecture, shellcheck warns that cputype is referenced but not assigned. Be on the safe side and do not use cputype if it is not defined or empty. * config.guess (*:Plan9:*:*): Fix shellcheck warning SC2154. --- config.guess | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/config.guess b/config.guess index 7d507bb..dc0a6b2 100755 --- a/config.guess +++ b/config.guess @@ -1437,10 +1437,9 @@ EOF # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - # shellcheck disable=SC2154 - if test "$cputype" = 386; then + if test "${cputype-}" = 386; then UNAME_MACHINE=i386 - else + elif test "x${cputype-}" != x; then UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9