diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2011-09-16 12:10:02 +0000 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2011-09-16 12:10:02 +0000 |
commit | bf93b4ddfe66baaca5d6aff20f72f06250d2de62 (patch) | |
tree | a2fe2697cb50e1a1c54b520c714209cda89a056a /tools/lvmcmdline.c | |
parent | b91e3e90839fb9892293b4195eb8babdf484a5e5 (diff) | |
download | lvm2-bf93b4ddfe66baaca5d6aff20f72f06250d2de62.tar.gz lvm2-bf93b4ddfe66baaca5d6aff20f72f06250d2de62.tar.xz lvm2-bf93b4ddfe66baaca5d6aff20f72f06250d2de62.zip |
Fix command line option decoding
LVM has huge set of options now - it's approaching 60 short-arg less options
and we get interesting case of misdetection for 'merge' option which has been
put into the middle of options with 'short_arg' - thus certainly past 65. (ASCII 'A').
To avoid confusion of short_arg with long_opt number - add '128' to all such
non-short-arg options.
Diffstat (limited to 'tools/lvmcmdline.c')
-rw-r--r-- | tools/lvmcmdline.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index a8e46b18..1dab59d5 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -641,7 +641,7 @@ static void _add_getopt_arg(int arg, char **ptr, struct option **o) if (a->short_arg) (*o)->val = a->short_arg; else - (*o)->val = arg; + (*o)->val = arg + 128; (*o)++; } #endif @@ -662,7 +662,7 @@ static int _find_arg(struct command *com, int opt) * the_args. */ if ((a->short_arg && (opt == a->short_arg)) || - (!a->short_arg && (opt == arg))) + (!a->short_arg && (opt == (arg + 128)))) return arg; } |