+2012-01-24 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/commands/wildcard.c (match_files): Handle filenames
+ without explicit device.
+ (wildcard_expand): Don't add explicit device if not already present.
+ * tests/grub_script_echo1.in: Add a new expansion test.
+
2012-01-24 Vladimir Serbinenko <phcoder@gmail.com>
Replace single-linked with double-linked lists. It results in more
if (! fs)
goto fail;
- path = grub_strchr (dir, ')');
- if (! path)
- goto fail;
- path++;
+ if (dir[0] == '(')
+ {
+ path = grub_strchr (dir, ')');
+ if (!path)
+ goto fail;
+ path++;
+ }
+ else
+ path = dir;
if (fs->dir (dev, path, match))
goto fail;
if (start == noregexop) /* device part has regexop */
paths = match_devices (®exp, *start != '(');
- else if (*start == '(') /* device part explicit wo regexop */
+ else /* device part explicit wo regexop */
paths = match_files ("", start, noregexop, ®exp);
-
- else if (*start == '/') /* no device part */
- {
- const char *root;
- char *prefix;
-
- root = grub_env_get ("root");
- if (! root)
- goto fail;
-
- prefix = grub_xasprintf ("(%s)", root);
- if (! prefix)
- goto fail;
-
- paths = match_files (prefix, start, noregexop, ®exp);
- grub_free (prefix);
- }
}
else
{