diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2015-02-09 22:08:37 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2015-02-09 22:08:37 +0200 |
commit | eb61bc58c20769cac4d05f363b9c0e8c9c71a560 (patch) | |
tree | 56baffd7b60399688119a88046a589711479d7d3 | |
parent | Add a few casts to tuklib_integer.h to silence possible warnings. (diff) | |
download | xz-eb61bc58c20769cac4d05f363b9c0e8c9c71a560.tar.xz |
xzdiff: Make the mktemp usage compatible with FreeBSD's mktemp.
Thanks to Rui Paulo for the fix.
-rw-r--r-- | src/scripts/xzdiff.in | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/scripts/xzdiff.in b/src/scripts/xzdiff.in index 79df3836..6aa6b989 100644 --- a/src/scripts/xzdiff.in +++ b/src/scripts/xzdiff.in @@ -140,7 +140,12 @@ elif test $# -eq 2; then (exit 2); exit 2 ' HUP INT PIPE TERM 0 if type mktemp >/dev/null 2>&1; then - tmp=`mktemp -t -d -- "$prog.XXXXXXXXXX"` || exit 2 + # Note that FreeBSD's mktemp isn't fully compatible with + # the implementations from mktemp.org and GNU coreutils. + # It is important that the -t argument is the last argument + # and that no "--" is used between -t and the template argument. + # This way this command works on all implementations. + tmp=`mktemp -d -t "$prog.XXXXXXXXXX"` || exit 2 else # Fallback code if mktemp is missing. This isn't as # robust as using mktemp since this doesn't try with |