← Commit list

264bdadb2

Denys Vlasenko
Denys Vlasenko
2010-09-06
FAILED Duration: 267s

Subject

blockdev: -2 bytes

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

util-linux/blockdev.c+9 -6
@@ -109,12 +109,15 @@ static const struct bdc bdcommands[] = {
static const struct bdc *find_cmd(const char *s)
{
- int j;
- if (*s++ == '-')
- if (*s++ == '-')
- for (j = 0; j < ARRAY_SIZE(bdcommands); j++)
- if (strcmp(s, bdcommands[j].name) == 0)
- return &bdcommands[j];
+ const struct bdc *bdcmd = bdcommands;
+ if (s[0] == '-' && s[1] == '-') {
+ s += 2;
+ do {
+ if (strcmp(s, bdcmd->name) == 0)
+ return bdcmd;
+ bdcmd++;
+ } while (bdcmd != bdcommands + ARRAY_SIZE(bdcommands));
+ }
bb_show_usage();
}