[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. b3c23f82ef21de29aa275
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-02-08 16:43:35
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via b3c23f82ef21de29aa275e22e7bbf33335946412 (commit) from 02a0f1303c41b1efb319f527f5b3dbb4d75df6ea (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b3c23f82ef21de29aa275e22e7bbf33335946412 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Feb 8 10:42:24 2021 -0600 Fix extra VFO: print out when rigctl --vfo is used and VFO argument is given https://github.com/Hamlib/Hamlib/issues/535 diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 363500e4..9ccbd83e 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -840,7 +840,10 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, { if (interactive) { - if (prompt) + arg1[0] = fgetc(fin); + arg1[1] = 0; + + if (prompt && arg1[0] == 0x0a) { fprintf_flush(fout, "VFO: "); } @@ -945,19 +948,18 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, if (interactive) { - int c = fgetc(fin); - rig_debug(RIG_DEBUG_TRACE, "%s: debug4 c=%02x\n", __func__, c); + int index = 1; + arg1[0] = fgetc(fin); + arg1[1] = 0; + rig_debug(RIG_DEBUG_TRACE, "%s: debug4 arg1=%c\n", __func__, arg1[0]); - if (prompt && c == 0x0a) + if (prompt && arg1[0] == 0x0a) { fprintf_flush(fout, "%s: ", cmd_entry->arg1); - } - else - { - ungetc(c, fin); + index = 0; } - if (scanfc(fin, "%s", arg1) < 1) + if (scanfc(fin, "%s", &arg1[index]) < 1) { rig_debug(RIG_DEBUG_WARN, "%s: nothing to scan#8?\n", __func__); return -1; ----------------------------------------------------------------------- Summary of changes: tests/rigctl_parse.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |