Add default arguments for the default programmer (only)
This code exists thanks to food for thought from Urja Rannikko.
Corresponding to flashrom svn r1814.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
diff --git a/cli_classic.c b/cli_classic.c
index a32d55b..fc1b9ba 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -396,8 +396,10 @@
if (prog == PROGRAMMER_INVALID) {
if (CONFIG_DEFAULT_PROGRAMMER != PROGRAMMER_INVALID) {
prog = CONFIG_DEFAULT_PROGRAMMER;
- msg_pinfo("Using default programmer \"%s\".\n",
- programmer_table[CONFIG_DEFAULT_PROGRAMMER].name);
+ /* We need to strdup here because we free(pparam) unconditionally later. */
+ pparam = strdup(CONFIG_DEFAULT_PROGRAMMER_ARGS);
+ msg_pinfo("Using default programmer \"%s\" with arguments \"%s\".\n",
+ programmer_table[CONFIG_DEFAULT_PROGRAMMER].name, pparam);
} else {
msg_perr("Please select a programmer with the --programmer parameter.\n"
"Previously this was not necessary because there was a default set.\n"