summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich Ölmann <u.oelmann@pengutronix.de>2019-02-03 22:47:58 +0100
committerRoland Hieber <rhi@pengutronix.de>2019-02-07 12:34:15 +0100
commit99918b8f3ad2bec78969434365a3be6ba5f44cdd (patch)
tree890670f4f5d51ce6f1eb74686b32f7b2c8374e98
parent0cd8a9b06523d6e840827d2d085550fab4c93d08 (diff)
downloaddt-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.c3
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) {