summaryrefslogtreecommitdiff
path: root/src/cp.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-06-30 16:47:00 +0000
committerJim Meyering <jim@meyering.net>2005-06-30 16:47:00 +0000
commit779a89cdb444cf4426eb31ab3d63b2575b29431f (patch)
tree01064c3b5bacb8c1583af5f5d86e8ba73418c4a1 /src/cp.c
parentf2daebf810ff4ee99fb3a2b03cce44e464944234 (diff)
downloadcoreutils-779a89cdb444cf4426eb31ab3d63b2575b29431f.tar.xz
Add uses of ARGMATCH_VERIFY to ensure that
corresponding option string and value arrays are consistent. Remove a harmless trailing `, 0' from a value list.
Diffstat (limited to 'src/cp.c')
-rw-r--r--src/cp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cp.c b/src/cp.c
index d413bf5ee..a2810c30c 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -94,23 +94,23 @@ static char const *const sparse_type_string[] =
{
"never", "auto", "always", NULL
};
-
static enum Sparse_type const sparse_type[] =
{
SPARSE_NEVER, SPARSE_AUTO, SPARSE_ALWAYS
};
+ARGMATCH_VERIFY (sparse_type_string, sparse_type);
/* Valid arguments to the `--reply' option. */
static char const* const reply_args[] =
{
"yes", "no", "query", NULL
};
-
/* The values that correspond to the above strings. */
static int const reply_vals[] =
{
I_ALWAYS_YES, I_ALWAYS_NO, I_ASK_USER
};
+ARGMATCH_VERIFY (reply_args, reply_vals);
static struct option const long_opts[] =
{
@@ -729,13 +729,13 @@ decode_preserve_arg (char const *arg, struct cp_options *x, bool on_off)
PRESERVE_MODE, PRESERVE_TIMESTAMPS,
PRESERVE_OWNERSHIP, PRESERVE_LINK, PRESERVE_ALL
};
-
/* Valid arguments to the `--preserve' option. */
static char const* const preserve_args[] =
{
"mode", "timestamps",
"ownership", "links", "all", NULL
};
+ ARGMATCH_VERIFY (preserve_args, preserve_vals);
char *arg_writable = xstrdup (arg);
char *s = arg_writable;