]> gcc.gnu.org Git - gcc.git/commitdiff
contrib: Quote variable in test expression [PR111360]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 12 Sep 2023 11:02:13 +0000 (12:02 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 12 Sep 2023 11:42:47 +0000 (12:42 +0100)
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.

contrib/gcc_update

index 1d7bfab4935bf256134a09c591b573109a0dbe93..cda2bdb0df915c9987ec16ea256218e5600872f5 100755 (executable)
@@ -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
This page took 0.064115 seconds and 5 git commands to generate.