]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
xz: Restrict when recursive mode can be used.
authorJia Tan <jiat0218@gmail.com>
Wed, 1 Nov 2023 06:43:03 +0000 (14:43 +0800)
committerJia Tan <jiat0218@gmail.com>
Mon, 29 Jan 2024 13:40:53 +0000 (21:40 +0800)
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

index 05e9c94c7b0c5b5c3b8eb998bc093989b4dccd52..efe179e34153e5d7c411dd5419f791f57b697473 100644 (file)
@@ -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.