X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=programs%2Fimagex.c;h=1972505824766aaad8be23eb9b91d5175ff0dcbf;hp=d6d261710f4e0e6adbba0086986d506ceabe71d0;hb=2a33c303e30fd740f740e21632fd06b9e414b0c7;hpb=6cc8db9fac4dcfdcd474ee49790a30a54b83c798 diff --git a/programs/imagex.c b/programs/imagex.c index d6d26171..19725058 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -29,7 +29,7 @@ #include #include #include -#include + #include #include #include @@ -43,6 +43,12 @@ #include #endif +#ifdef __WIN32__ +# include "imagex-win32.h" +#else +# include +#endif + #define ARRAY_LEN(array) (sizeof(array) / sizeof(array[0])) #define for_opt(c, opts) while ((c = getopt_long_only(argc, (char**)argv, "", \ @@ -733,6 +739,7 @@ static int open_swms_from_glob(const char *swm_glob, 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) { @@ -1322,9 +1329,10 @@ static int imagex_export(int argc, char **argv) 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; }