From 79549b168d8cb9d72225386e36e27d93536984b5 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sat, 3 Jul 2021 11:05:40 +0300 Subject: [PATCH] config.sub: normalize the quoting in the `echo FOO | sed ...` Some cases quote the argument to echo and some do not. At runtime it probably does not matter because the substituted values will never contain whitespace, but quoting them all would make shellcheck more useful. * config.sub: Consistently quote the argument of echo. * doc/config.sub.1: Regenerate. Suggested-by: Jacob Bachmeyer Signed-off-by: Ozkan Sezer Signed-off-by: Dmitry V. Levin --- config.sub | 18 +++++++++--------- doc/config.sub.1 | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config.sub b/config.sub index dbf1e74..fdbb2b1 100755 --- a/config.sub +++ b/config.sub @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2021 Free Software Foundation, Inc. -timestamp='2021-06-03' +timestamp='2021-07-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -1292,15 +1292,15 @@ then case $basic_os in gnu/linux*) kernel=linux - os=`echo $basic_os | sed -e 's|gnu/linux|gnu|'` + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 - os=`echo $basic_os | sed -e 's|os2-emx|emx|'` + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto - os=`echo $basic_os | sed -e 's|nto-qnx|qnx|'` + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) # shellcheck disable=SC2162 @@ -1311,11 +1311,11 @@ EOF # Default OS when just kernel was specified nto*) kernel=nto - os=`echo $basic_os | sed -e 's|nto|qnx|'` + os=`echo "$basic_os" | sed -e 's|nto|qnx|'` ;; linux*) kernel=linux - os=`echo $basic_os | sed -e 's|linux|gnu|'` + os=`echo "$basic_os" | sed -e 's|linux|gnu|'` ;; *) kernel= @@ -1336,7 +1336,7 @@ case $os in os=cnk ;; solaris1 | solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` + os=`echo "$os" | sed -e 's|solaris1|sunos4|'` ;; solaris) os=solaris2 @@ -1365,7 +1365,7 @@ case $os in os=sco3.2v4 ;; sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'` ;; sco*v* | scout) # Don't match below @@ -1441,7 +1441,7 @@ case $os in ;; # Preserve the version number of sinix5. sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` + os=`echo "$os" | sed -e 's|sinix|sysv|'` ;; sinix*) os=sysv4 diff --git a/doc/config.sub.1 b/doc/config.sub.1 index 727ce77..1eb5818 100644 --- a/doc/config.sub.1 +++ b/doc/config.sub.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.16. -.TH CONFIG.SUB "1" "June 2021" "GNU config.sub (2021-06-03)" "User Commands" +.TH CONFIG.SUB "1" "July 2021" "GNU config.sub (2021-07-03)" "User Commands" .SH NAME config.sub \- validate and canonicalize a configuration triplet .SH SYNOPSIS