public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-3879] contrib: Quote variable in test expression [PR111360]
@ 2023-09-12 11:45 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-09-12 11:45 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:df63338236b91ba79d5f89fce9b16e0c34b2bada

commit r14-3879-gdf63338236b91ba79d5f89fce9b16e0c34b2bada
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Sep 12 12:02:13 2023 +0100

    contrib: Quote variable in test expression [PR111360]
    
    Without the quotes some shells will always return true and some will
    print an error. It should be quoted so that a null variable works as
    intended.
    
    contrib/ChangeLog:
    
            PR other/111360
            * gcc_update: Quote variable.

Diff:
---
 contrib/gcc_update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/gcc_update b/contrib/gcc_update
index 1d7bfab4935b..cda2bdb0df91 100755
--- a/contrib/gcc_update
+++ b/contrib/gcc_update
@@ -343,7 +343,7 @@ case $vcs_type in
 	revision=`$GCC_GIT log -n1 --pretty=tformat:%h`
 	r=`$GCC_GIT describe --all --match 'basepoints/gcc-[0-9]*' HEAD \
 	   | sed -n 's,^\(tags/\)\?basepoints/gcc-\([0-9]\+\)-\([0-9]\+\)-g[0-9a-f]*$,r\2-\3,p;s,^\(tags/\)\?basepoints/gcc-\([0-9]\+\)$,r\2-0,p'`;
-	if test -n $r; then
+	if test -n "$r"; then
 		o=`$GCC_GIT config --get gcc-config.upstream`;
 		rr=`echo $r | sed -n 's,^r\([0-9]\+\)-[0-9]\+\(-g[0-9a-f]\+\)\?$,\1,p'`;
 		if $GCC_GIT rev-parse --verify --quiet ${o:-origin}/releases/gcc-$rr >/dev/null; then

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-12 11:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-12 11:45 [gcc r14-3879] contrib: Quote variable in test expression [PR111360] Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).