mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 09:58:01 +00:00
Autoconf workaround for missing <glob.h>.
glob.h is another missing facility in Android+Termux. The workaround is to condition out local wildcard support completely, so that PSFTP commands like 'mput *.txt' won't manage to do anything. But at least the program will compile.
This commit is contained in:
parent
9375d1325f
commit
c2df294e9e
@ -175,7 +175,7 @@ AC_CHECK_LIB(X11, XOpenDisplay,
|
|||||||
|
|
||||||
AC_CHECK_FUNCS([getaddrinfo posix_openpt ptsname setresuid strsignal updwtmpx fstatat dirfd futimes setpwent endpwent])
|
AC_CHECK_FUNCS([getaddrinfo posix_openpt ptsname setresuid strsignal updwtmpx fstatat dirfd futimes setpwent endpwent])
|
||||||
AC_CHECK_DECLS([CLOCK_MONOTONIC], [], [], [[#include <time.h>]])
|
AC_CHECK_DECLS([CLOCK_MONOTONIC], [], [], [[#include <time.h>]])
|
||||||
AC_CHECK_HEADERS([sys/auxv.h asm/hwcap.h])
|
AC_CHECK_HEADERS([sys/auxv.h asm/hwcap.h glob.h])
|
||||||
AC_SEARCH_LIBS([clock_gettime], [rt], [AC_DEFINE([HAVE_CLOCK_GETTIME],[],[Define if clock_gettime() is available])])
|
AC_SEARCH_LIBS([clock_gettime], [rt], [AC_DEFINE([HAVE_CLOCK_GETTIME],[],[Define if clock_gettime() is available])])
|
||||||
|
|
||||||
AC_CACHE_CHECK([for SO_PEERCRED and dependencies], [x_cv_linux_so_peercred], [
|
AC_CACHE_CHECK([for SO_PEERCRED and dependencies], [x_cv_linux_so_peercred], [
|
||||||
|
@ -12,12 +12,15 @@
|
|||||||
#include <utime.h>
|
#include <utime.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <glob.h>
|
|
||||||
|
|
||||||
#include "putty.h"
|
#include "putty.h"
|
||||||
#include "ssh.h"
|
#include "ssh.h"
|
||||||
#include "psftp.h"
|
#include "psftp.h"
|
||||||
|
|
||||||
|
#if HAVE_GLOB_H
|
||||||
|
#include <glob.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In PSFTP our selects are synchronous, so these functions are
|
* In PSFTP our selects are synchronous, so these functions are
|
||||||
* empty stubs.
|
* empty stubs.
|
||||||
@ -358,6 +361,7 @@ int test_wildcard(const char *name, bool cmdline)
|
|||||||
*/
|
*/
|
||||||
return WCTYPE_NONEXISTENT;
|
return WCTYPE_NONEXISTENT;
|
||||||
} else {
|
} else {
|
||||||
|
#if HAVE_GLOB_H
|
||||||
glob_t globbed;
|
glob_t globbed;
|
||||||
int ret = WCTYPE_NONEXISTENT;
|
int ret = WCTYPE_NONEXISTENT;
|
||||||
|
|
||||||
@ -368,12 +372,18 @@ int test_wildcard(const char *name, bool cmdline)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
#else
|
||||||
|
/* On a system without glob.h, we just have to return a
|
||||||
|
* failure code */
|
||||||
|
return WCTYPE_NONEXISTENT;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actually return matching file names for a local wildcard.
|
* Actually return matching file names for a local wildcard.
|
||||||
*/
|
*/
|
||||||
|
#if HAVE_GLOB_H
|
||||||
struct WildcardMatcher {
|
struct WildcardMatcher {
|
||||||
glob_t globbed;
|
glob_t globbed;
|
||||||
int i;
|
int i;
|
||||||
@ -400,6 +410,20 @@ void finish_wildcard_matching(WildcardMatcher *dir) {
|
|||||||
globfree(&dir->globbed);
|
globfree(&dir->globbed);
|
||||||
sfree(dir);
|
sfree(dir);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
WildcardMatcher *begin_wildcard_matching(const char *name)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
char *wildcard_get_filename(WildcardMatcher *dir)
|
||||||
|
{
|
||||||
|
unreachable("Can't construct a valid WildcardMatcher without <glob.h>");
|
||||||
|
}
|
||||||
|
void finish_wildcard_matching(WildcardMatcher *dir)
|
||||||
|
{
|
||||||
|
unreachable("Can't construct a valid WildcardMatcher without <glob.h>");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
char *stripslashes(const char *str, bool local)
|
char *stripslashes(const char *str, bool local)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user