mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
command: validation code only for man-generator
Don't waste time with string order validation within command, check within 'man-generator -c' is enough.
This commit is contained in:
parent
25236a963f
commit
f86bdcb6e9
@ -384,12 +384,14 @@ static uint64_t _lv_to_bits(struct command *cmd, char *name)
|
|||||||
|
|
||||||
static unsigned _find_lvm_command_enum(const char *name)
|
static unsigned _find_lvm_command_enum(const char *name)
|
||||||
{
|
{
|
||||||
static int _command_names_count = -1;
|
|
||||||
int first = 0, last, middle;
|
int first = 0, last, middle;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
#ifdef MAN_PAGE_GENERATOR
|
||||||
|
/* Validate cmd_names & command_names arrays are properly sorted */
|
||||||
|
static int _command_names_count = -1;
|
||||||
|
|
||||||
if (_command_names_count == -1) {
|
if (_command_names_count == -1) {
|
||||||
/* Validate cmd_names & command_names arrays are properly sorted */
|
|
||||||
for (i = 1; i < CMD_COUNT - 2; i++)
|
for (i = 1; i < CMD_COUNT - 2; i++)
|
||||||
if (strcmp(cmd_names[i].name, cmd_names[i + 1].name) > 0) {
|
if (strcmp(cmd_names[i].name, cmd_names[i + 1].name) > 0) {
|
||||||
log_error("File cmds.h has unsorted name entry %s.",
|
log_error("File cmds.h has unsorted name entry %s.",
|
||||||
@ -404,7 +406,8 @@ static unsigned _find_lvm_command_enum(const char *name)
|
|||||||
}
|
}
|
||||||
_command_names_count = i - 1;
|
_command_names_count = i - 1;
|
||||||
}
|
}
|
||||||
last = _command_names_count;
|
#endif
|
||||||
|
last = LVM_COMMAND_COUNT - 1;
|
||||||
|
|
||||||
while (first <= last) {
|
while (first <= last) {
|
||||||
middle = first + (last - first) / 2;
|
middle = first + (last - first) / 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user