ShellCheck dislikes unused variables in 'read unused_var', rather
use 'read _'.

Drop always-true condition in src/liblzma/common/index.c that made
Coverity think that the 'newg' might leak out.
---
 src/liblzma/common/index.c | 3 +--
 src/scripts/xzless.in      | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/liblzma/common/index.c b/src/liblzma/common/index.c
index 26e4e519..caa982c1 100644
--- a/src/liblzma/common/index.c
+++ b/src/liblzma/common/index.c
@@ -825,8 +825,7 @@ lzma_index_cat(lzma_index *restrict dest, lzma_index 
*restrict src,
                                s->groups.root = &newg->node;
                        }
 
-                       if (s->groups.rightmost == &g->node)
-                               s->groups.rightmost = &newg->node;
+                       s->groups.rightmost = &newg->node;
 
                        lzma_free(g, allocator);
 
diff --git a/src/scripts/xzless.in b/src/scripts/xzless.in
index 288dd871..1b85ad6f 100644
--- a/src/scripts/xzless.in
+++ b/src/scripts/xzless.in
@@ -46,7 +46,7 @@ if test "${LESSMETACHARS+set}" != set; then
        LESSMETACHARS="$space$tab$nl'"';*?"()<>[|&^`#\$%=~'
 fi
 
-if test "$(less -V | { read less ver re && echo ${ver}; })" -ge 429; then
+if test "$(less -V | { read _ ver _ && echo ${ver}; })" -ge 429; then
        # less 429 or later: LESSOPEN pipe will be used on
        # standard input if $LESSOPEN begins with |-.
        LESSOPEN="|-$xz -cdfq -- %s"
-- 
2.17.1


Reply via email to