c9760d
--- gzip-1.3.12/znew.in.owl-tmp	2007-06-04 09:15:11.000000000 +0200
c9760d
+++ gzip-1.3.12/znew.in	2007-06-04 09:23:18.000000000 +0200
c9760d
@@ -55,28 +55,27 @@
c9760d
 # block is the disk block size (best guess, need not be exact)
c9760d
 
c9760d
 warn="(does not preserve modes and timestamp)"
c9760d
-tmp=${TMPDIR-/tmp}/zfoo.$$
c9760d
-set -C
c9760d
-echo hi > $tmp || exit
c9760d
-if test -z "`(${CPMOD-cpmod} $tmp $tmp) 2>&1`"; then
c9760d
-  cpmod=${CPMOD-cpmod}
c9760d
+cpmod= 
c9760d
+cpmodarg= 
c9760d
+if type ${CPMOD:-cpmod} 2>/dev/null; then 
c9760d
+  cpmod=${CPMOD:-cpmod} 
c9760d
   warn=""
c9760d
 fi
c9760d
 
c9760d
-if test -z "$cpmod" && ${TOUCH-touch} -r $tmp $tmp 2>/dev/null; then
c9760d
-  cpmod="${TOUCH-touch}"
c9760d
+if test -z "$cpmod"; then 
c9760d
+  cpmod=touch 
c9760d
   cpmodarg="-r"
c9760d
   warn="(does not preserve file modes)"
c9760d
 fi
c9760d
 
c9760d
-# check if GZIP env. variable uses -S or --suffix
c9760d
-gzip -q $tmp
c9760d
-ext=`echo $tmp* | sed "s|$tmp||"`
c9760d
-rm -f $tmp*
c9760d
-if test -z "$ext"; then
c9760d
-  echo znew: error determining gzip extension
c9760d
-  exit 1
c9760d
-fi
c9760d
+case "$GZIP" in                                                                  
c9760d
+  *-S*) ext=`echo "$GZIP" | sed 's/^.*-S[[:space:]]*\([^[:space:]]*\).*$/\1/'`   
c9760d
+       ;;                                                                        
c9760d
+  *-suffix*) ext=`echo "$GZIP" | sed 's/^.*--suffix=\([^[:space:]]*\).*$/\1/'`   
c9760d
+       ;;                                                                        
c9760d
+  *) ext='.gz'                                                                   
c9760d
+       ;;                                                                        
c9760d
+esac  
c9760d
 if test "$ext" = ".Z"; then
c9760d
   echo znew: cannot use .Z as gzip extension.
c9760d
   exit 1