From: Jia Tan Date: Wed, 1 Nov 2023 06:43:03 +0000 (+0800) Subject: xz: Restrict when recursive mode can be used. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8c199bcdc0534a99946cb4d15c271e8778d882c;p=thirdparty%2Fxz.git xz: Restrict when recursive mode can be used. If we are not compiling with dirent.h or MSVC, then we cannot use recursive mode. Unfortunatly, there is not a great portable way to parse directory contents. There are _find_next() functions available for DOS like platforms, but Windows version of these functions is different. Since we do not have a good way to test these functions, support will not be added at this time. --- diff --git a/src/xz/args.c b/src/xz/args.c index 05e9c94c..efe179e3 100644 --- a/src/xz/args.c +++ b/src/xz/args.c @@ -814,6 +814,11 @@ args_parse(args_info *args, int argc, char **argv) "is not supported")); #endif +#if !defined(_MSC_VER) && !defined(HAVE_DIRENT_H) + if (opt_recursive) + message_fatal("Recursive mode is not supported"); +#endif + // Never remove the source file when the destination is not on disk. // In test mode the data is written nowhere, but setting opt_stdout // will make the rest of the code behave well.