- /* Scan our string for the start of a delim (delim_start), and the
- * start of any new text (delim_end). */
- for (i = 0; i < len; i++) {
- if (is_delim(word->text[i])) {
- if (delim_start == -1)
- delim_start = i;
- } else if (delim_start != -1) {
- delim_end = i;
- break;
- }
+ default_idx = strtoul(var, &end, 10);
+ if (end != var && *end == '\0')
+ return default_idx == script->n_options;
+
+ /* if we don't have an explicit id for this option, fall back to
+ * the name */
+ if (!id)
+ id = opt->option->name;
+
+ return !strcmp(id, var);
+}
+
+static void append_text_to_current_arg(struct grub2_argv *argv,
+ const char *text, int len)
+{
+ char *cur = argv->argv[argv->argc - 1];
+
+ if (cur) {
+ int curlen = strlen(cur);
+ cur = talloc_realloc(argv->argv, cur, char, len + curlen + 1);
+ memcpy(cur + curlen, text, len);
+ cur[len + curlen] = '\0';
+
+ } else {
+ cur = talloc_strndup(argv->argv, text, len);