about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/command/cmd_defs.c2
-rw-r--r--src/tools/parser.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index c2a6ad18..558b02bd 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -2443,7 +2443,7 @@ static struct cmd_t command_defs[] = {
     },
 
     { "/correct",
-      parse_args, 1, -1, NULL,
+      parse_args_with_freetext, 1, 1, NULL,
       CMD_NOSUBFUNCS
       CMD_MAINFUNC(cmd_correct)
       CMD_TAGS(
diff --git a/src/tools/parser.c b/src/tools/parser.c
index 240d5358..2e1d5c98 100644
--- a/src/tools/parser.c
+++ b/src/tools/parser.c
@@ -48,7 +48,7 @@
  *
  * inp - The line of input
  * min - The minimum allowed number of arguments
- * max - The maximum allowed number of arguments, -1 for infinite
+ * max - The maximum allowed number of arguments
  *
  * Returns - An NULL terminated array of strings representing the arguments
  * of the command, or NULL if the validation fails.
@@ -135,7 +135,7 @@ parse_args(const char* const inp, int min, int max, gboolean* result)
     int num = g_slist_length(tokens) - 1;
 
     // if num args not valid return NULL
-    if ((num < min) || ((max != -1) && (num > max))) {
+    if ((num < min) || (num > max)) {
         g_slist_free_full(tokens, free);
         g_free(copy);
         *result = FALSE;
or: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
parse/0: instruction: copy
parse/0:   ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]}
parse/0:   product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]}
parse/0: instruction: copy
parse/0:   ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]}
parse/0:   product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]}
after-brace/0: recipe main
after-brace/0: copy ...
after-brace/0: copy ...
new/0: routine allocated memory from 1000 to 101000
schedule/0: main
run/0: instruction main/0
run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy {name: "23", value: 23, type: 0, properties: ["23": "literal"]}
run/0: ingredient 0 is 23
mem/0: storing 23 in location 1
run/0: instruction main/1
run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy {name: "1", value: 1, type: 1, properties: ["1": "integer"]}
run/0: ingredient 0 is 1
mem/0: location 1 is 23
mem/0: storing 23 in location 2