]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Hook up fnmatch for platforms that don't have it.
authorDarren Tucker <dtucker@dtucker.net>
Fri, 1 Nov 2019 07:24:29 +0000 (18:24 +1100)
committerDarren Tucker <dtucker@dtucker.net>
Fri, 1 Nov 2019 07:27:37 +0000 (18:27 +1100)
configure.ac
openbsd-compat/Makefile.in
openbsd-compat/fnmatch.c
openbsd-compat/fnmatch.h
openbsd-compat/openbsd-compat.h
scp.c

index a9cbfed0c8d79bdab8813b0c25490219d5e36455..dcb44915d74d04da801c8f74d26757a24d16055a 100644 (file)
@@ -382,6 +382,7 @@ AC_CHECK_HEADERS([ \
        features.h \
        fcntl.h \
        floatingpoint.h \
+       fnmatch.h \
        getopt.h \
        glob.h \
        ia.h \
@@ -1738,6 +1739,7 @@ AC_CHECK_FUNCS([ \
        fchown \
        fchownat \
        flock \
+       fnmatch \
        freeaddrinfo \
        freezero \
        fstatfs \
index 1162dc55053da4fe0d245b0cb3bab4dcdfe428ea..94fb0a55e61655d17c515d4c97ea9ebf11aea801 100644 (file)
@@ -25,6 +25,7 @@ OPENBSD=base64.o \
        explicit_bzero.o \
        fmt_scaled.o \
        freezero.o \
+       fnmatch.o \
        getcwd.o \
        getgrouplist.o \
        getopt_long.o \
index 88d5dbc3c83b680435be8298bfbbab39697cbabb..da841d203d388cd11a9f93cec0ed57fb97b694f6 100644 (file)
  * path delimiter must be aware that 0x5C is NOT unique within SHIFT-JIS.
  */
 
+/* OPENBSD ORIGINAL: lib/libc/gen/fnmatch.c */
+
+#include "includes.h"
+#ifndef HAVE_FNMATCH
+
 #include <fnmatch.h>
 #include <string.h>
 #include <ctype.h>
@@ -487,3 +492,4 @@ firstsegment:
        /* Pattern didn't match to the end of string. */
        return FNM_NOMATCH;
 }
+#endif /* HAVE_FNMATCH */
index 4b27d06c3dbcc1cdfd9a9fc62641633366dd95d4..b54de01ffdf2384a519cfd944d0720452ee45f64 100644 (file)
  *     @(#)fnmatch.h   8.1 (Berkeley) 6/2/93
  */
 
+/* OPENBSD ORIGINAL: include/fnmatch.h */
+
+#ifndef HAVE_FNMATCH_H
+
 #ifndef        _FNMATCH_H_
 #define        _FNMATCH_H_
 
+#ifdef HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
+#endif
 
 #define        FNM_NOMATCH     1       /* Match failed. */
 #define        FNM_NOSYS       2       /* Function not supported (unused). */
@@ -50,8 +56,9 @@
 #define        FNM_FILE_NAME   FNM_PATHNAME
 #endif
 
-__BEGIN_DECLS
+/* __BEGIN_DECLS */
 int     fnmatch(const char *, const char *, int);
-__END_DECLS
+/* __END_DECLS */
 
 #endif /* !_FNMATCH_H_ */
+#endif /* ! HAVE_FNMATCH_H */
index 97b344b65400c0541a5ab95379d4b486c4215887..afe882f92e1d40e879b48bc129ee5f45f6509c6d 100644 (file)
@@ -47,6 +47,7 @@
 #include "rmd160.h"
 #include "md5.h"
 #include "blf.h"
+#include "fnmatch.h"
 
 #ifndef HAVE_BASENAME
 char *basename(const char *path);
diff --git a/scp.c b/scp.c
index 0348d0673bff0d91737b3d8c9f13f3f130ab9453..762286c73aaa896a2da3c88fbf7af0a204869611 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -94,7 +94,9 @@
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
+#ifdef HAVE_FNMATCH_H
 #include <fnmatch.h>
+#endif
 #include <limits.h>
 #include <locale.h>
 #include <pwd.h>