diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2023-09-12 12:02:13 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2023-09-12 12:42:47 +0100 |
commit | df63338236b91ba79d5f89fce9b16e0c34b2bada (patch) | |
tree | 6c820b6b230db43e4d55b7b95ebaed07e96504c9 | |
parent | e08559271b2d797f658579ac8610dbf5e58bcfd8 (diff) | |
download | gcc-df63338236b91ba79d5f89fce9b16e0c34b2bada.zip gcc-df63338236b91ba79d5f89fce9b16e0c34b2bada.tar.gz gcc-df63338236b91ba79d5f89fce9b16e0c34b2bada.tar.bz2 |
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.
-rwxr-xr-x | contrib/gcc_update | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/gcc_update b/contrib/gcc_update index 1d7bfab..cda2bdb 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 |