Change in ...libosmocore[master]: vty: command.c: Get rid of big indentation block

laforge gerrit-no-reply at lists.osmocom.org
Fri Jun 14 21:54:18 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/libosmocore/+/14430 )

Change subject: vty: command.c: Get rid of big indentation block
......................................................................

vty: command.c: Get rid of big indentation block

This block will become bigger in forthcoming commits.

Change-Id: Ibc1494014b1e77ce10950f7268a44d2d2091a6f2
---
M src/vty/command.c
1 file changed, 38 insertions(+), 38 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved
  laforge: Looks good to me, approved



diff --git a/src/vty/command.c b/src/vty/command.c
index b26e991..17d28fe 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -2294,27 +2294,27 @@
 	argc = 0;
 
 	for (i = 0; i < vector_active(vline); i++) {
-		if (varflag)
-			argv[argc++] = vector_slot(vline, i);
-		else {
-			vector descvec =
-			    vector_slot(matched_element->strvec, i);
-
-			if (vector_active(descvec) == 1) {
-				struct desc *desc = vector_slot(descvec, 0);
-
-				if (CMD_VARARG(desc->cmd))
-					varflag = 1;
-
-				if (varflag || CMD_VARIABLE(desc->cmd)
-				    || CMD_OPTION(desc->cmd))
-					argv[argc++] = vector_slot(vline, i);
-			} else
-				argv[argc++] = vector_slot(vline, i);
-		}
-
 		if (argc == CMD_ARGC_MAX)
 			return CMD_ERR_EXEED_ARGC_MAX;
+		if (varflag) {
+			argv[argc++] = vector_slot(vline, i);
+			continue;
+		}
+
+		vector descvec = vector_slot(matched_element->strvec, i);
+
+		if (vector_active(descvec) == 1) {
+			struct desc *desc = vector_slot(descvec, 0);
+
+			if (CMD_VARARG(desc->cmd))
+				varflag = 1;
+
+			if (varflag || CMD_VARIABLE(desc->cmd)
+			    || CMD_OPTION(desc->cmd))
+				argv[argc++] = vector_slot(vline, i);
+		} else {
+			argv[argc++] = vector_slot(vline, i);
+		}
 	}
 
 	/* For vtysh execution. */
@@ -2439,27 +2439,27 @@
 	argc = 0;
 
 	for (i = 0; i < vector_active(vline); i++) {
-		if (varflag)
-			argv[argc++] = vector_slot(vline, i);
-		else {
-			vector descvec =
-			    vector_slot(matched_element->strvec, i);
-
-			if (vector_active(descvec) == 1) {
-				struct desc *desc = vector_slot(descvec, 0);
-
-				if (CMD_VARARG(desc->cmd))
-					varflag = 1;
-
-				if (varflag || CMD_VARIABLE(desc->cmd)
-				    || CMD_OPTION(desc->cmd))
-					argv[argc++] = vector_slot(vline, i);
-			} else
-				argv[argc++] = vector_slot(vline, i);
-		}
-
 		if (argc == CMD_ARGC_MAX)
 			return CMD_ERR_EXEED_ARGC_MAX;
+		if (varflag) {
+			argv[argc++] = vector_slot(vline, i);
+			continue;
+		}
+
+		vector descvec = vector_slot(matched_element->strvec, i);
+
+		if (vector_active(descvec) == 1) {
+			struct desc *desc = vector_slot(descvec, 0);
+
+			if (CMD_VARARG(desc->cmd))
+				varflag = 1;
+
+			if (varflag || CMD_VARIABLE(desc->cmd)
+			    || CMD_OPTION(desc->cmd))
+				argv[argc++] = vector_slot(vline, i);
+		} else {
+			argv[argc++] = vector_slot(vline, i);
+		}
 	}
 
 	/* For vtysh execution. */

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/14430
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ibc1494014b1e77ce10950f7268a44d2d2091a6f2
Gerrit-Change-Number: 14430
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190614/397a9c04/attachment.html>


More information about the gerrit-log mailing list