summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/gzip/zdiff
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2002-01-25 15:02:01 +0000
committernectar <nectar@FreeBSD.org>2002-01-25 15:02:01 +0000
commitd021da72fe1f0e17a65b88e33f0789d27c77b31f (patch)
tree3434d72cfff4714697fce06d41fac55ac83334db /gnu/usr.bin/gzip/zdiff
parentf01473321b2705adcd979c5c897cf3dbb21b5bb1 (diff)
downloadFreeBSD-src-d021da72fe1f0e17a65b88e33f0789d27c77b31f.zip
FreeBSD-src-d021da72fe1f0e17a65b88e33f0789d27c77b31f.tar.gz
Use mktemp(1) when creating temporary files.
Diffstat (limited to 'gnu/usr.bin/gzip/zdiff')
-rw-r--r--gnu/usr.bin/gzip/zdiff7
1 files changed, 4 insertions, 3 deletions
diff --git a/gnu/usr.bin/gzip/zdiff b/gnu/usr.bin/gzip/zdiff
index ebc9eca..310a201 100644
--- a/gnu/usr.bin/gzip/zdiff
+++ b/gnu/usr.bin/gzip/zdiff
@@ -47,10 +47,11 @@ elif test $# -eq 2; then
case "$2" in
*[-.]gz* | *[-.][zZ] | *.t[ga]z)
F=`echo "$2" | sed 's|.*/||;s|[-.][zZtga]*||'`
- gzip -cdfq "$2" > /tmp/"$F".$$
- gzip -cdfq "$1" | $comp $OPTIONS - /tmp/"$F".$$
+ tmp=`mktemp -t "$F"`
+ gzip -cdfq "$2" > "$tmp"
+ gzip -cdfq "$1" | $comp $OPTIONS - "$tmp"
STAT="$?"
- /bin/rm -f /tmp/"$F".$$;;
+ /bin/rm -f "$tmp";;
*) gzip -cdfq "$1" | $comp $OPTIONS - "$2"
STAT="$?";;
OpenPOWER on IntegriCloud