pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/41704?usp=email )
Change subject: vty: assert in optional param followed by optional-multi-choice param: Fix [2/2]
......................................................................
vty: assert in optional param followed by optional-multi-choice param: Fix [2/2]
in cmd_make_descr, cp during the asserting iteration looks like this:
(gdb) print cp
$18 = 0x555555c1939d ") [(one|two|three)"
As a result, first multiple is set to 0 and later on logic was missing
for this specific case.
Change-Id: I4c184db53bec28ab42bcd45e033733d850eea5d2
Fixes: b55f4d2df21b966c3953264d8961f259814f4650
Related: OS#6360
---
M src/vty/command.c
1 file changed, 6 insertions(+), 0 deletions(-)
Approvals:
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/vty/command.c b/src/vty/command.c
index 8594290..c1bda8a 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -443,6 +443,12 @@
while (isspace((int)*cp) && *cp != '\0')
cp++;
+ /* Explicitly detect optional multi-choice braces like [(one|two)]. */
+ if (cp[0] == '[' && cp[1] == '(') {
+ optional_brace = 1;
+ cp++;
+ }
+
if (*cp == '(') {
multiple = 1;
cp++;
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41704?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4c184db53bec28ab42bcd45e033733d850eea5d2
Gerrit-Change-Number: 41704
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: falconia, fixeria, neels.
pespin has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/libosmocore/+/35961?usp=email )
Change subject: vty: assert in optional param followed by optional-multi-choice param: Reproduce [1/2]
......................................................................
Patch Set 5: Code-Review+2 Verified+1
(1 comment)
Patchset:
PS5:
I'm removing the jenkins -1 since I'm merging this together with the fix and they are properly named to show they go together.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35961?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6ad93a304ce498ba9d57fc7e2fd238e6c16e29e0
Gerrit-Change-Number: 35961
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 18 Dec 2025 12:43:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Attention is currently required from: falconia, neels, osmith, pespin.
pespin has uploaded a new patch set (#5) to the change originally created by fixeria. ( https://gerrit.osmocom.org/c/libosmocore/+/35961?usp=email )
The following approvals got outdated and were removed:
Code-Review+1 by osmith, Verified-1 by Jenkins Builder
Change subject: vty: assert in optional param followed by optional-multi-choice param: Reproduce [1/2]
......................................................................
vty: assert in optional param followed by optional-multi-choice param: Reproduce [1/2]
The test added below makes cmd_make_descvec() assert in
"OSMO_ASSERT(multiple);" line, so it's expected to fail during CI.
Follow-up patch provides a fixes for it.
Change-Id: I6ad93a304ce498ba9d57fc7e2fd238e6c16e29e0
Related: b55f4d2df21b966c3953264d8961f259814f4650
Related: OS#6360
---
M tests/vty/vty_transcript_test.c
M tests/vty/vty_transcript_test.vty
2 files changed, 37 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/61/35961/5
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35961?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6ad93a304ce498ba9d57fc7e2fd238e6c16e29e0
Gerrit-Change-Number: 35961
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>