aboutsummaryrefslogtreecommitdiff
path: root/archival/cpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/cpio.c')
-rw-r--r--archival/cpio.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/archival/cpio.c b/archival/cpio.c
index 38bab8257..f2165be3a 100644
--- a/archival/cpio.c
+++ b/archival/cpio.c
@@ -360,9 +360,8 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
360 char *cpio_owner; 360 char *cpio_owner;
361 IF_FEATURE_CPIO_O(const char *cpio_fmt = "";) 361 IF_FEATURE_CPIO_O(const char *cpio_fmt = "";)
362 unsigned opt; 362 unsigned opt;
363
364#if ENABLE_LONG_OPTS 363#if ENABLE_LONG_OPTS
365 applet_long_options = 364 const char *long_opts =
366 "extract\0" No_argument "i" 365 "extract\0" No_argument "i"
367 "list\0" No_argument "t" 366 "list\0" No_argument "t"
368#if ENABLE_FEATURE_CPIO_O 367#if ENABLE_FEATURE_CPIO_O
@@ -390,9 +389,9 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
390 /* -L makes sense only with -o or -p */ 389 /* -L makes sense only with -o or -p */
391 390
392#if !ENABLE_FEATURE_CPIO_O 391#if !ENABLE_FEATURE_CPIO_O
393 opt = getopt32(argv, OPTION_STR, &cpio_filename, &cpio_owner); 392 opt = getopt32long(argv, OPTION_STR, long_opts, &cpio_filename, &cpio_owner);
394#else 393#else
395 opt = getopt32(argv, OPTION_STR "oH:" IF_FEATURE_CPIO_P("p"), 394 opt = getopt32long(argv, OPTION_STR "oH:" IF_FEATURE_CPIO_P("p"), long_opts,
396 &cpio_filename, &cpio_owner, &cpio_fmt); 395 &cpio_filename, &cpio_owner, &cpio_fmt);
397#endif 396#endif
398 argv += optind; 397 argv += optind;