diff options
author | Jakub Jelen <jjelen@redhat.com> | 2017-12-11 15:37:02 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2017-12-21 11:43:19 +0100 |
commit | b8e301ade328fdfbef37e967241fc5da67111975 (patch) | |
tree | 9b24d8c0d25c5d775fed05047235d12bd9192578 /src | |
parent | 99c5160cb5a1a169f86d334017efde4cef23ead8 (diff) | |
download | libssh-b8e301ade328fdfbef37e967241fc5da67111975.tar.gz libssh-b8e301ade328fdfbef37e967241fc5da67111975.tar.xz libssh-b8e301ade328fdfbef37e967241fc5da67111975.zip |
config: Add CMake check for glob()
Diffstat (limited to 'src')
-rw-r--r-- | src/config.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c index cedf34e4..a95e0b63 100644 --- a/src/config.c +++ b/src/config.c @@ -27,7 +27,9 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> -#include <glob.h> +#ifdef HAVE_GLOB_H +# include <glob.h> +#endif #include "libssh/priv.h" #include "libssh/session.h" @@ -317,6 +319,7 @@ static void local_parse_file(ssh_session session, const char *filename, int *par return; } +#ifdef HAVE_GLOB static void local_parse_glob(ssh_session session, const char *fileglob, int *parsing, @@ -343,6 +346,7 @@ static void local_parse_glob(ssh_session session, globfree(&globbuf); } +#endif /* HAVE_GLOB */ static int ssh_config_parse_line(ssh_session session, const char *line, unsigned int count, int *parsing, int seen[]) { @@ -389,7 +393,11 @@ static int ssh_config_parse_line(ssh_session session, const char *line, p = ssh_config_get_str_tok(&s, NULL); if (p && *parsing) { +#ifdef HAVE_GLOB local_parse_glob(session, p, parsing, seen); +#else + local_parse_file(session, p, parsing, seen); +#endif /* HAVE_GLOB */ } break; case SOC_HOST: { |