Module Name:    othersrc
Committed By:   lukem
Date:           Thu Jan 24 02:57:10 UTC 2019

Modified Files:
        othersrc/libexec/tnftpd/libnetbsd: fnmatch.c

Log Message:
fnmatch.c: minimise changes from NetBSD src


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/libnetbsd/fnmatch.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/libexec/tnftpd/libnetbsd/fnmatch.c
diff -u othersrc/libexec/tnftpd/libnetbsd/fnmatch.c:1.4 othersrc/libexec/tnftpd/libnetbsd/fnmatch.c:1.5
--- othersrc/libexec/tnftpd/libnetbsd/fnmatch.c:1.4	Wed Jan 23 05:13:48 2019
+++ othersrc/libexec/tnftpd/libnetbsd/fnmatch.c	Thu Jan 24 02:57:10 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: fnmatch.c,v 1.4 2019/01/23 05:13:48 lukem Exp $ */
+/* $NetBSD: fnmatch.c,v 1.5 2019/01/24 02:57:10 lukem Exp $ */
 /* from NetBSD: fnmatch.c,v 1.26 2014/10/12 22:32:33 christos Exp */
 
 /*
@@ -35,11 +35,35 @@
 
 #include "tnftpd.h"
 
+#if 0
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
+static char sccsid[] = "@(#)fnmatch.c	8.2 (Berkeley) 4/16/94";
+#else
+__RCSID("$NetBSD: fnmatch.c,v 1.5 2019/01/24 02:57:10 lukem Exp $");
+#endif
+#endif /* LIBC_SCCS and not lint */
+
 /*
  * Function fnmatch() as specified in POSIX 1003.2-1992, section B.6.
  * Compares a filename or pathname to a pattern.
  */
 
+#include "namespace.h"
+
+#include <assert.h>
+#include <ctype.h>
+#include <fnmatch.h>
+#include <string.h>
+
+#ifdef __weak_alias
+__weak_alias(fnmatch,_fnmatch)
+#endif
+
+#endif
+
 #define	EOS	'\0'
 
 static inline int
@@ -59,6 +83,8 @@ rangematch(const char *pattern, int test
 	int negate, ok, need;
 	char c, c2;
 
+	_DIAGASSERT(pattern != NULL);
+
 	/*
 	 * A bracket expression starting with an unquoted circumflex
 	 * character produces unspecified results (IEEE 1003.2-1992,
@@ -101,6 +127,9 @@ fnmatchx(const char *pattern, const char
 	const char *stringstart, *r;
 	char c, test;
 
+	_DIAGASSERT(pattern != NULL);
+	_DIAGASSERT(string != NULL);
+
 	if (recursion-- == 0)
 		return FNM_NORES;
 

Reply via email to