From 418f86c659dc9295530f2e3e7bf9ae4c67dfa877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Sutre?= Date: Mon, 12 Aug 2013 11:49:33 +0200 Subject: [PATCH] Prevent shadowing of stdlib's devname(3) on BSD. --- ChangeLog | 7 +++++++ grub-core/disk/cryptodisk.c | 16 ++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0658222dc..128d13e3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-08-12 Grégoire Sutre + + Prevent shadowing of stdlib's devname(3) on BSD. + + * grub-core/disk/cryptodisk.c (grub_cmd_cryptomount): Rename devname + and devlast to diskname and disklast, respectively. + 2013-08-11 Colin Watson * util/grub-mkconfig.in: Fix detection of Emacs autosave files. diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c index 6fbfc4a39..456c60846 100644 --- a/grub-core/disk/cryptodisk.c +++ b/grub-core/disk/cryptodisk.c @@ -937,20 +937,20 @@ grub_cmd_cryptomount (grub_extcmd_context_t ctxt, int argc, char **args) grub_err_t err; grub_disk_t disk; grub_cryptodisk_t dev; - char *devname; - char *devlast; + char *diskname; + char *disklast; search_uuid = NULL; check_boot = state[2].set; - devname = args[0]; - if (devname[0] == '(' && *(devlast = &devname[grub_strlen (devname) - 1]) == ')') + diskname = args[0]; + if (diskname[0] == '(' && *(disklast = &diskname[grub_strlen (diskname) - 1]) == ')') { - *devlast = '\0'; - disk = grub_disk_open (devname + 1); - *devlast = ')'; + *disklast = '\0'; + disk = grub_disk_open (diskname + 1); + *disklast = ')'; } else - disk = grub_disk_open (devname); + disk = grub_disk_open (diskname); if (!disk) return grub_errno;