Parcourir la source

Fix completion for nested optional parameters

git-svn-id: https://klish.googlecode.com/svn/trunk@475 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev il y a 13 ans
Parent
commit
8be419a217
1 fichiers modifiés avec 10 ajouts et 10 suppressions
  1. 10 10
      clish/shell/shell_parse.c

+ 10 - 10
clish/shell/shell_parse.c

@@ -209,16 +209,16 @@ clish_pargv_status_t clish_shell_parse_pargv(clish_pargv_t *pargv,
 				 */
 				if (!(clish_param__get_optional(param) &&
 					(*idx == need_index) &&
-					(need_index == (argc - 1))))
-				(*idx)++;
-
-				/* Walk through the nested parameters */
-				if (rec_paramc) {
-					retval = clish_shell_parse_pargv(pargv, cmd,
-						context, rec_paramv,
-						argv, idx, last, need_index);
-					if (CLISH_LINE_OK != retval)
-						return retval;
+					(need_index == (argc - 1)))) {
+					(*idx)++;
+					/* Walk through the nested parameters */
+					if (rec_paramc) {
+						retval = clish_shell_parse_pargv(pargv, cmd,
+							context, rec_paramv,
+							argv, idx, last, need_index);
+						if (CLISH_LINE_OK != retval)
+							return retval;
+					}
 				}
 
 				/* Choose the next parameter */