diff options
| author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-09-06 15:34:15 +0200 |
|---|---|---|
| committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-09-06 15:34:15 +0200 |
| commit | 264bdadb2c0406474a4e874a3b16cb57661e6b3a (patch) | |
| tree | 30d99f539baba30281201f632f0670dc273e5138 | |
| parent | b4e6b419340452d2e0fedc9f0f88c5fd102982de (diff) | |
| download | busybox-w32-264bdadb2c0406474a4e874a3b16cb57661e6b3a.tar.gz busybox-w32-264bdadb2c0406474a4e874a3b16cb57661e6b3a.tar.bz2 busybox-w32-264bdadb2c0406474a4e874a3b16cb57661e6b3a.zip | |
blockdev: -2 bytes
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
| -rw-r--r-- | util-linux/blockdev.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/util-linux/blockdev.c b/util-linux/blockdev.c index fea30b009..2b48c28c9 100644 --- a/util-linux/blockdev.c +++ b/util-linux/blockdev.c | |||
| @@ -109,12 +109,15 @@ static const struct bdc bdcommands[] = { | |||
| 109 | 109 | ||
| 110 | static const struct bdc *find_cmd(const char *s) | 110 | static const struct bdc *find_cmd(const char *s) |
| 111 | { | 111 | { |
| 112 | int j; | 112 | const struct bdc *bdcmd = bdcommands; |
| 113 | if (*s++ == '-') | 113 | if (s[0] == '-' && s[1] == '-') { |
| 114 | if (*s++ == '-') | 114 | s += 2; |
| 115 | for (j = 0; j < ARRAY_SIZE(bdcommands); j++) | 115 | do { |
| 116 | if (strcmp(s, bdcommands[j].name) == 0) | 116 | if (strcmp(s, bdcmd->name) == 0) |
| 117 | return &bdcommands[j]; | 117 | return bdcmd; |
| 118 | bdcmd++; | ||
| 119 | } while (bdcmd != bdcommands + ARRAY_SIZE(bdcommands)); | ||
| 120 | } | ||
| 118 | bb_show_usage(); | 121 | bb_show_usage(); |
| 119 | } | 122 | } |
| 120 | 123 | ||
