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:
parent
e110f4dea7
commit
4a11b60f10
2 changed files with 9 additions and 4 deletions
|
@ -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>
|
2009-07-06 Daniel Mierswa <impulze@impulze.org>
|
||||||
|
|
||||||
* commands/search.c (search_fs): Use grub_strcasecmp() for UUID
|
* commands/search.c (search_fs): Use grub_strcasecmp() for UUID
|
||||||
|
|
|
@ -68,17 +68,17 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid)
|
||||||
{
|
{
|
||||||
grub_fs_t fs;
|
grub_fs_t fs;
|
||||||
int (*compare_fn) (const char *, const char *);
|
int (*compare_fn) (const char *, const char *);
|
||||||
|
grub_err_t (*quid_fn) (grub_device_t, char **);
|
||||||
|
|
||||||
fs = grub_fs_probe (dev);
|
fs = grub_fs_probe (dev);
|
||||||
compare_fn = is_uuid ? grub_strcasecmp : grub_strcmp;
|
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_fn)
|
||||||
|
|
||||||
if (fs && QUID(fs))
|
|
||||||
{
|
{
|
||||||
char *quid;
|
char *quid;
|
||||||
|
|
||||||
(QUID(fs)) (dev, &quid);
|
quid_fn (dev, &quid);
|
||||||
if (grub_errno == GRUB_ERR_NONE && quid)
|
if (grub_errno == GRUB_ERR_NONE && quid)
|
||||||
{
|
{
|
||||||
if (compare_fn (quid, key) == 0)
|
if (compare_fn (quid, key) == 0)
|
||||||
|
|
Loading…
Reference in a new issue