cp: fix option handling in non-longopt config
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 11 Feb 2018 20:25:23 +0000 (21:25 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 14 Feb 2018 16:38:40 +0000 (17:38 +0100)
the patch getopt32: remove opt_complementary 22542eca18e5807b72ddc78999f5101e33f17a53

introduced a regressed in the cp command since it removed all aliases of arguments
if long_opts is not configured.

Patch by Sebastian Gottschall <s.gottschall@dd-wrt.com>

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/cp.c

index a76af7b7c4a7984c07556699598cf113023367f6..35ca5e00742a1d73a44b962f52e729c80c7774d5 100644 (file)
@@ -100,7 +100,11 @@ int cp_main(int argc, char **argv)
                "parents\0"        No_argument "\xfe"
        );
 #else
-       flags = getopt32(argv, FILEUTILS_CP_OPTSTR);
+       flags = getopt32(argv, "^"
+               FILEUTILS_CP_OPTSTR
+               "\0"
+               "-2:l--s:s--l:Pd:rRd:Rd:apdR"
+       );
 #endif
        /* Options of cp from GNU coreutils 6.10:
         * -a, --archive