Commit ae7659c4 for xz
commit ae7659c43c7941dc846302504f92a63806227848
Author: Lasse Collin <lasse.collin@tukaani.org>
Date: Wed Nov 4 12:18:04 2026 +0200
xzdiff: Fix generation of the temporary filename
It didn't regonize .gz, .zst, or .lz4 suffixes. For example,
xzdiff -u foo.gz bar.gz
displayed "/tmp/xzdiff.xxxxxxxxxx/xzdiff" as the second filename
instead of "/tmp/xzdiff.xxxxxxxxxx/bar". The first filename displayed
is still "-" because only one temporary file is used.
The use of a temporary file is a fallback method that isn't used on most
systems. When /dev/fd is available, the filenames are "/dev/fd/5" and "-".
diff --git a/src/scripts/xzdiff.in b/src/scripts/xzdiff.in
index 4aab4dd8..607aa4a8 100644
--- a/src/scripts/xzdiff.in
+++ b/src/scripts/xzdiff.in
@@ -147,7 +147,7 @@ elif test $# -eq 2; then
eval "$cmp" /dev/fd/5 - >&3) 5<&0
)
else
- F=`LC_ALL=C expr "/$2" : '.*/\(.*\)[-.][ablmotxz2]*$'` || F=$prog
+ F=`LC_ALL=C expr "/$2" : '.*/\(.*\)[-.][abglmostxzZ24]*$'` || F=$prog
tmp=
trap '
test -n "$tmp" && rm -rf "$tmp"