summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorEnrico Jorns <ejo@pengutronix.de>2017-11-01 08:27:06 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-11-03 08:51:21 +0100
commit31fd03b3807309ce033ba7285dadeea3bfc4e566 (patch)
treed7132390c57edbc285710ac6eb8fce05e8215be9 /commands
parent7bdd225eeb168498939b8d45d83f6b998ee3866f (diff)
downloadbarebox-31fd03b3807309ce033ba7285dadeea3bfc4e566.tar.gz
commands: nv: call nvvar_print() only if no argument is given
Printing the nv variables (before performing any modification!) is useless and irritating. Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/nv.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/commands/nv.c b/commands/nv.c
index 798b1ea..2e6d079 100644
--- a/commands/nv.c
+++ b/commands/nv.c
@@ -44,14 +44,15 @@ static int do_nv(int argc, char *argv[])
}
}
- if (do_save)
- return nvvar_save();
-
- if (argc == optind) {
+ if (argc == 1) {
nvvar_print();
return 0;
}
+ if (do_save) {
+ return nvvar_save();
+ }
+
argc -= optind;
argv += optind;