blob: 4811fa21110873cbb3f4502e127422b036f88db1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
$NetBSD: patch-ac,v 1.5 2002/12/16 11:39:01 wiz Exp $
--- src/fnmatch.c.orig Sat May 18 05:05:15 2002
+++ src/fnmatch.c
@@ -198,6 +198,17 @@ fnmatch (const char *pattern, const char
return (FNM_NOMATCH);
}
+/* Return non-zero if S has a leading '/' or contains '../' */
+int
+has_invalid_name (const char *s)
+{
+ if (*s == '/')
+ return 1;
+ if (strstr(s, "../") != 0)
+ return 1;
+ return 0;
+}
+
/* Return non-zero if S contains globbing wildcards (`*', `?', `[' or
`]'). */
int
|