File: check_file_state.patch

package info (click to toggle)
html2ps 1.0b7-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,208 kB
  • sloc: perl: 4,539; tcl: 1,799; sh: 38; makefile: 4
file content (16 lines) | stat: -rw-r--r-- 519 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Last-Update: 2011-08-06
Description: Checks if file is usable before referencing it

diff --git a/html2ps b/html2ps
index 2876275..66c1bfb 100755
--- a/html2ps
+++ b/html2ps
@@ -495,6 +495,8 @@ die "Ghostscript is required to generate DSC PostScript\n"
 die "Ghostscript is required to generate cross references\n"
  if($opt_R && !$package{'Ghostscript'});
 $tmpname=$posix?POSIX::tmpnam():"h2p_$$";
+sysopen TMP, $tmpname, O_RDWR|O_CREAT|O_EXCL, 0600 or die "$!";
+close TMP;
 ($scr=$tmpname)=~/\w+$/;
 $tempdir=$`;