diff options
author | Ulrich Ölmann <u.oelmann@pengutronix.de> | 2019-02-03 22:47:58 +0100 |
---|---|---|
committer | Roland Hieber <rhi@pengutronix.de> | 2019-02-07 12:34:15 +0100 |
commit | 99918b8f3ad2bec78969434365a3be6ba5f44cdd (patch) | |
tree | 890670f4f5d51ce6f1eb74686b32f7b2c8374e98 | |
parent | 0cd8a9b06523d6e840827d2d085550fab4c93d08 (diff) | |
download | dt-utils-99918b8f3ad2bec78969434365a3be6ba5f44cdd.tar.gz dt-utils-99918b8f3ad2bec78969434365a3be6ba5f44cdd.tar.xz |
barebox-state: fix usage of multiple state instances
Let's assume there are two state instances named "blue" (with variable "x") and
"yellow" (with variable "y") then
$ barebox-state --name blue --get x
$ barebox-state --name yellow --get y
would both work, whereas only exactly one of the alternative calls
$ barebox-state --get blue.x
$ barebox-state --get yellow.y
would succeed. This commit fixes that bug.
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
-rw-r--r-- | src/barebox-state.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/barebox-state.c b/src/barebox-state.c index 3e6c260..76d0475 100644 --- a/src/barebox-state.c +++ b/src/barebox-state.c @@ -581,9 +581,10 @@ int main(int argc, char *argv[]) list_for_each_entry(state, &state_list.list, list) { if (strlen(state->name) == statename_len && - !strncmp(state->name, sg->arg, statename_len)) + !strncmp(state->name, sg->arg, statename_len)) { arg = statename_end + 1; break; + } } } if (state == &state_list) { |