summaryrefslogtreecommitdiff
path: root/print/gv/patches/patch-ag
blob: 01780864cc198ae600137ed3cfe6b29138671548 (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
$NetBSD: patch-ag,v 1.1 2002/10/04 03:00:12 itojun Exp $

http://www.epita.fr/~bevand_m/asa/asa-0000

diff -ur source/file.c source/file.c
--- source/file.c	1997-06-07 00:00:00.000000000 +0200
+++ source/file.c	2002-09-26 23:56:00.000000000 +0200
@@ -285,6 +285,22 @@
 }
 
 /*############################################################*/
+/* file_nameIsDangerous */
+/*############################################################*/
+
+char *file_charsAllowedInName = "+,-./:=@\\^_";
+
+int
+file_nameIsDangerous(fn)
+  char *fn;
+{
+  for (; *fn; fn++)
+    if (!isalnum(*fn) && !strchr(file_charsAllowedInName, *fn))
+      return(1);
+  return(0);
+}
+
+/*############################################################*/
 /* file_pdfname2psname */
 /* If the file ends in .pdf, change this to .ps.*/
 /* Return pointer to temp copy if changed, else to input string. */