From: Vladimir Serbinenko Date: Wed, 13 Nov 2013 08:26:13 +0000 (+0100) Subject: * grub-core/normal/datetime.c (grub_get_weekday): Use if rather than X-Git-Tag: grub-2.02-beta1~351 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2e9294fb9141e4cbb553fd92c502f0a2cf58f7b;p=thirdparty%2Fgrub.git * grub-core/normal/datetime.c (grub_get_weekday): Use if rather than division. --- diff --git a/ChangeLog b/ChangeLog index 9970ac89e..16c6ef6e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-11-13 Vladimir Serbinenko + + * grub-core/normal/datetime.c (grub_get_weekday): Use if rather than + division. + 2013-11-13 Vladimir Serbinenko * grub-core/kern/uboot/init.c: Move grub_uboot_machine_type and diff --git a/grub-core/normal/datetime.c b/grub-core/normal/datetime.c index 7e548acdf..95b8c9ff5 100644 --- a/grub-core/normal/datetime.c +++ b/grub-core/normal/datetime.c @@ -36,7 +36,10 @@ grub_get_weekday (struct grub_datetime *datetime) { unsigned a, y, m; - a = (14 - datetime->month) / 12; + if (datetime->month <= 2) + a = 1; + else + a = 0; y = datetime->year - a; m = datetime->month + 12 * a - 2;