2009-07-06 Pavel Roskin <proski@gnu.org>

* commands/search.c (search_fs): Replace QUID macro with quid_fn
	function pointer.
This commit is contained in:
proski 2009-07-06 20:13:06 +00:00
parent e110f4dea7
commit 4a11b60f10
2 changed files with 9 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2009-07-06 Pavel Roskin <proski@gnu.org>
* commands/search.c (search_fs): Replace QUID macro with quid_fn
function pointer.
2009-07-06 Daniel Mierswa <impulze@impulze.org>
* commands/search.c (search_fs): Use grub_strcasecmp() for UUID

View file

@ -68,17 +68,17 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid)
{
grub_fs_t fs;
int (*compare_fn) (const char *, const char *);
grub_err_t (*quid_fn) (grub_device_t, char **);
fs = grub_fs_probe (dev);
compare_fn = is_uuid ? grub_strcasecmp : grub_strcmp;
quid_fn = is_uuid ? fs->uuid : fs->label;
#define QUID(x) (is_uuid ? (x)->uuid : (x)->label)
if (fs && QUID(fs))
if (fs && quid_fn)
{
char *quid;
(QUID(fs)) (dev, &quid);
quid_fn (dev, &quid);
if (grub_errno == GRUB_ERR_NONE && quid)
{
if (compare_fn (quid, key) == 0)