Prevent shadowing of stdlib's devname(3) on BSD.

This commit is contained in:
Grégoire Sutre 2013-08-12 11:49:33 +02:00
parent c137aea04b
commit 418f86c659
2 changed files with 15 additions and 8 deletions

View file

@ -1,3 +1,10 @@
2013-08-12 Grégoire Sutre <gregoire.sutre@gmail.com>
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 <cjwatson@ubuntu.com>
* util/grub-mkconfig.in: Fix detection of Emacs autosave files.

View file

@ -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;