mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 03:22:48 -05: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:
@ -12,12 +12,15 @@
|
||||
#include <utime.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <glob.h>
|
||||
|
||||
#include "putty.h"
|
||||
#include "ssh.h"
|
||||
#include "psftp.h"
|
||||
|
||||
#if HAVE_GLOB_H
|
||||
#include <glob.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* In PSFTP our selects are synchronous, so these functions are
|
||||
* empty stubs.
|
||||
@ -358,6 +361,7 @@ int test_wildcard(const char *name, bool cmdline)
|
||||
*/
|
||||
return WCTYPE_NONEXISTENT;
|
||||
} else {
|
||||
#if HAVE_GLOB_H
|
||||
glob_t globbed;
|
||||
int ret = WCTYPE_NONEXISTENT;
|
||||
|
||||
@ -368,12 +372,18 @@ int test_wildcard(const char *name, bool cmdline)
|
||||
}
|
||||
|
||||
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.
|
||||
*/
|
||||
#if HAVE_GLOB_H
|
||||
struct WildcardMatcher {
|
||||
glob_t globbed;
|
||||
int i;
|
||||
@ -400,6 +410,20 @@ void finish_wildcard_matching(WildcardMatcher *dir) {
|
||||
globfree(&dir->globbed);
|
||||
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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user