]>
Commit | Line | Data |
---|---|---|
6cd89d07 | 1 | --- gzip-1.2.4/gzexe.in.ewt Wed Jan 28 15:30:41 1998 |
2 | +++ gzip-1.2.4/gzexe.in Wed Jan 28 15:37:14 1998 | |
3 | @@ -90,18 +90,22 @@ | |
4 | if test $decomp -eq 0; then | |
5 | sed 1q $0 > $tmp | |
6 | sed "s|^if tail|if $tail|" >> $tmp <<'EOF' | |
7 | -skip=18 | |
8 | -if tail +$skip $0 | "/bin"/gzip -cd > /tmp/gztmp$$; then | |
9 | - /bin/chmod 700 /tmp/gztmp$$ | |
10 | +skip=22 | |
11 | +tmpfile=`mktemp /tmp/gz$$.XXXXXX` || { | |
12 | + echo 'cannot create a temporary file' >&2 | |
13 | + exit 1 | |
14 | +} | |
15 | +if tail +$skip $0 | "/bin"/gzip -cd > $tmpfile; then | |
16 | + /bin/chmod 700 $tmpfile | |
17 | prog="`echo $0 | /bin/sed 's|^.*/||'`" | |
18 | - if /bin/ln /tmp/gztmp$$ "/tmp/$prog" 2>/dev/null; then | |
19 | - trap '/bin/rm -f /tmp/gztmp$$ "/tmp/$prog"; exit $res' 0 | |
20 | - (/bin/sleep 5; /bin/rm -f /tmp/gztmp$$ "/tmp/$prog") 2>/dev/null & | |
21 | + if /bin/ln $tmpfile "/tmp/$prog" 2>/dev/null; then | |
22 | + trap '/bin/rm -f $tmpfile "/tmp/$prog"; exit $res' 0 | |
23 | + (/bin/sleep 5; /bin/rm -f $tmpfile "/tmp/$prog") 2>/dev/null & | |
24 | /tmp/"$prog" ${1+"$@"}; res=$? | |
25 | else | |
26 | - trap '/bin/rm -f /tmp/gztmp$$; exit $res' 0 | |
27 | - (/bin/sleep 5; /bin/rm -f /tmp/gztmp$$) 2>/dev/null & | |
28 | - /tmp/gztmp$$ ${1+"$@"}; res=$? | |
29 | + trap '/bin/rm -f $tmpfile; exit $res' 0 | |
30 | + (/bin/sleep 5; /bin/rm -f $tmpfile) 2>/dev/null & | |
31 | + $tmpfile ${1+"$@"}; res=$? | |
32 | fi | |
33 | else | |
34 | echo Cannot decompress $0; exit 1 | |
35 | @@ -116,7 +120,7 @@ | |
36 | ||
37 | else | |
38 | # decompression | |
39 | - skip=18 | |
40 | + skip=22 | |
41 | if sed -e 1d -e 2q "$i" | grep "^skip=[0-9]*$" >/dev/null; then | |
42 | eval `sed -e 1d -e 2q "$i"` | |
43 | fi |