From f8c199bcdc0534a99946cb4d15c271e8778d882c Mon Sep 17 00:00:00 2001 From: Jia Tan Date: Wed, 1 Nov 2023 14:43:03 +0800 Subject: [PATCH] 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. --- src/xz/args.c | 5 +++++ 1 file changed, 5 insertions(+) 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.