1
0
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:
Zdenek Kabelac 2024-05-12 22:07:58 +02:00
parent 25236a963f
commit f86bdcb6e9

View File

@ -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 int _command_names_count = -1;
int first = 0, last, middle;
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) {
/* Validate cmd_names & command_names arrays are properly sorted */
for (i = 1; i < CMD_COUNT - 2; i++)
if (strcmp(cmd_names[i].name, cmd_names[i + 1].name) > 0) {
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;
}
last = _command_names_count;
#endif
last = LVM_COMMAND_COUNT - 1;
while (first <= last) {
middle = first + (last - first) / 2;