summaryrefslogtreecommitdiff
path: root/devel/noweb/patches/patch-am
blob: ab228fd90d395cdc1f12b855f20a89acf80ef677 (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
$NetBSD: patch-am,v 1.1 2006/05/23 16:07:04 joerg Exp $

--- shell/roff.mm.orig	1998-08-18 21:33:04.000000000 +0200
+++ shell/roff.mm
@@ -214,7 +214,7 @@ copy the awk program into a temporary fi
 .ADDLIST 1a
 .PRINTLIST
 
-awkfile="/tmp/noweb$$.awk"
+awkfile=$(@MKTEMP@ -t noweb) || { echo "$0: Cannot create temporary file" >&2; exit 1;  }
 trap 'rm -f $awkfile' 0 1 2 10 14 15
 cat > $awkfile \&<< 'EOF'
 \c
@@ -1628,14 +1628,15 @@ base="`basename $1 | sed '/\./s/\.[^.]*$
 tagsfile="$base.nwt"
 (echo ".so $macrodir/tmac.w"
 if [ -r "$tagsfile" ]; then 
-   cp $tagsfile /tmp/tags.$$
+   tagstemp=$(@MKTEMP@ -t tags) || { echo "$0: Cannot create temporary file" >&2; exit 1;  }
+   cp $tagsfile $tagstemp
    $AWK '\c
 .USE "action for \*[BEGINCONVQUOTE]tags\*[ENDCONVQUOTE] line" 11c
 \&
          \c
 .USE "functions" 8a
-\&' /tmp/tags.$$
-   rm -f /tmp/tags.$$
+\&' $tagstemp
+   rm -f $tagstemp
  fi
  cat "$@") |
 ($ROFF $opts 2>$tagsfile)