summaryrefslogtreecommitdiffstats
path: root/groff-1.18.1.1-sectmp.patch
blob: de553ca18ff8c2f6f773c896094cf2aa183c250b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--- groff-1.18.1.1/contrib/pic2graph/pic2graph.sh.sectmp	2006-02-16 16:27:38.000000000 +0100
+++ groff-1.18.1.1/contrib/pic2graph/pic2graph.sh	2006-02-16 16:22:43.000000000 +0100
@@ -73,11 +73,12 @@
 # 2. Process through eqn and pic to emit troff markup.
 # 3. Process through groff to emit Postscript.
 # 4. Use convert(1) to crop the PostScript and turn it into a bitmap.
-tmp=/tmp/pic2graph-$$
-trap "rm ${tmp}.*" 0 2 15 
+tmpps=`mktemp /tmp/pic2graph-XXXXXXXX.ps`
+tmpfmt=`mktemp /tmp/pic2graph-XXXXXXXX.$format`
+trap "rm $tmpps $tmpfmt" 0 2 15 
 (echo ".EQ"; echo $eqndelim; echo ".EN"; echo ".PS"; cat; echo ".PE") | \
-       groff -e -p $groffpic_opts -Tps >${tmp}.ps \
-       && convert -crop 0x0 $convert_opts ${tmp}.ps ${tmp}.${format} \
-       && cat ${tmp}.${format}
+       groff -e -p $groffpic_opts -Tps >$tmpps \
+       && convert -crop 0x0 $convert_opts $tmpps $tmpfmt \
+       && cat $tmpfmt
 
 # End
--- groff-1.18.1.1/contrib/eqn2graph/eqn2graph.sh.sectmp	2006-02-16 16:27:38.000000000 +0100
+++ groff-1.18.1.1/contrib/eqn2graph/eqn2graph.sh	2006-02-16 16:06:27.000000000 +0100
@@ -63,12 +63,13 @@
 # 2. Process through eqn(1) to emit troff markup.
 # 3. Process through groff(1) to emit Postscript.
 # 4. Use convert(1) to crop the Postscript and turn it into a bitmap.
-tmp=/tmp/eqn2graph-$$
-trap "rm ${tmp}.*" 0 2 15 
+tmpps=`mktemp /tmp/eqn2graph-XXXXXXXX.ps`
+tmpfmt=`mktemp /tmp/eqn2graph-XXXXXXXX.$format`
+trap "rm $tmpps $tmpfmt" 0 2 15 
 read equation
 (echo ".EQ"; echo 'delim $$'; echo ".EN"; echo '$'"${equation}"'$') | \
-	groff -e $groff_opts -Tps >${tmp}.ps \
-	&& convert -crop 0x0 $convert_opts ${tmp}.ps ${tmp}.${format} \
-	&& cat ${tmp}.${format}
+	groff -e $groff_opts -Tps >$tmpps \
+	&& convert -crop 0x0 $convert_opts $tmpps $tmpfmt \
+	&& cat $tmpfmt
 
 # End