#include <ctype.h>
#include <errno.h>
#include <getopt.h>
-#include <glob.h>
+
#include <inttypes.h>
#include <libgen.h>
#include <limits.h>
#include <alloca.h>
#endif
+#ifdef __WIN32__
+# include "imagex-win32.h"
+#else
+# include <glob.h>
+#endif
+
#define ARRAY_LEN(array) (sizeof(array) / sizeof(array[0]))
#define for_opt(c, opts) while ((c = getopt_long_only(argc, (char**)argv, "", \
glob_t globbuf;
int ret;
+ /* Warning: glob() is replaced in Windows native builds */
ret = glob(swm_glob, GLOB_ERR | GLOB_NOSORT, NULL, &globbuf);
if (ret != 0) {
if (ret == GLOB_NOMATCH) {
wim_is_new = false;
/* Destination file exists. */
- if (!S_ISREG(stbuf.st_mode) && !S_ISLNK(stbuf.st_mode)) {
+
+ if (!S_ISREG(stbuf.st_mode)) {
imagex_error("`%s' is not a regular file",
- dest_wimfile);
+ dest_wimfile);
ret = -1;
goto out;
}