From 4a11b60f1054d7524f2b4ed96fa40298314077d9 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 6 Jul 2009 20:13:06 +0000 Subject: [PATCH] 2009-07-06 Pavel Roskin * commands/search.c (search_fs): Replace QUID macro with quid_fn function pointer. --- ChangeLog | 5 +++++ commands/search.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 521a32c54..fd741626a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-06 Pavel Roskin + + * commands/search.c (search_fs): Replace QUID macro with quid_fn + function pointer. + 2009-07-06 Daniel Mierswa * commands/search.c (search_fs): Use grub_strcasecmp() for UUID diff --git a/commands/search.c b/commands/search.c index d749bca11..b29eefb41 100644 --- a/commands/search.c +++ b/commands/search.c @@ -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)