+ val = parse_unquoted(str);
+ break;
+ }
+
+ if (required && !val) {
+ ctx->pctx->byte = *str - ctx->pctx->buf;
+ UCI_THROW(ctx, UCI_ERR_PARSE);
+ }
+
+ return val;
+}
+
+/*
+ * verify that the end of the line or command is reached.
+ * throw an error if extra arguments are given on the command line
+ */
+static void assert_eol(struct uci_context *ctx, char **str)
+{
+ char *tmp;
+
+ tmp = next_arg(ctx, str, false);
+ if (tmp && *tmp) {
+ ctx->pctx->byte = tmp - ctx->pctx->buf;
+ UCI_THROW(ctx, UCI_ERR_PARSE);