]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/normal/datetime.c (grub_get_weekday): Use if rather than
authorVladimir Serbinenko <phcoder@gmail.com>
Wed, 13 Nov 2013 08:26:13 +0000 (09:26 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Wed, 13 Nov 2013 08:26:13 +0000 (09:26 +0100)
division.

ChangeLog
grub-core/normal/datetime.c

index 9970ac89eb2c0321007995c517bf6443ad478484..16c6ef6e86bf04522914715aaf94aaf2a5920413 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-13  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/normal/datetime.c (grub_get_weekday): Use if rather than
+       division.
+
 2013-11-13  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/kern/uboot/init.c: Move grub_uboot_machine_type and
index 7e548acdf51f10caa0a634eb5860900db58599b1..95b8c9ff5e37a4e1cf316cd593469e23d96af9e7 100644 (file)
@@ -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;