summaryrefslogtreecommitdiff
path: root/devel/noweb/patches/patch-af
blob: a1ab836176fd5b0bd4757dac6e77123d16de5283 (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
$NetBSD: patch-af,v 1.1.2.2 2006/05/24 00:05:17 salo Exp $

--- shell/noroff.orig	1999-02-16 22:58:52.000000000 +0100
+++ shell/noroff
@@ -35,9 +35,10 @@ fi
 
 base="`basename $1 | sed '/\./s/\.[^.]*$//'`"
 tagsfile="$base.nwt"
+tmpfile=$(@MKTEMP@ tags) || exit 1
 (echo ".so $macrodir/tmac.w"
 if [ -r "$tagsfile" ]; then 
-   cp $tagsfile /tmp/tags.$$
+   cp $tagsfile $tmpfile
    $AWK '{
 	     if      (sub(/^###TAG### /       , "")) tags[$1] = $2
 	     else if (sub(/^###BEGINCHUNKS###/, "")) printf ".de CLIST\n.CLISTBEGIN\n"
@@ -88,8 +89,8 @@ if [ -r "$tagsfile" ]; then 
 	 #	print str3
 	 #	print convquote(str3)
 	 # }
-	 function tag(s) { if (s in tags) return tags[s]; else return "???" }' /tmp/tags.$$
-   rm -f /tmp/tags.$$
+	 function tag(s) { if (s in tags) return tags[s]; else return "???" }' $tmpfile
+   rm -f $tmpfile
  fi
  cat "$@") |
 ($ROFF $opts 2>$tagsfile)