Blame SOURCES/0455-Add-X-option-to-printf-functions.patch

f96e0b
From 2a71d2434b01daaafa64cd340ea441def459d880 Mon Sep 17 00:00:00 2001
f96e0b
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
f96e0b
Date: Tue, 27 Nov 2012 16:58:39 -0200
f96e0b
Subject: [PATCH 455/482] Add %X option to printf functions.
f96e0b
f96e0b
---
f96e0b
 grub-core/kern/misc.c | 7 +++++--
f96e0b
 1 file changed, 5 insertions(+), 2 deletions(-)
f96e0b
f96e0b
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
f96e0b
index 94b88a3..d5ca312 100644
f96e0b
--- a/grub-core/kern/misc.c
f96e0b
+++ b/grub-core/kern/misc.c
f96e0b
@@ -596,7 +596,7 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r)
f96e0b
 static char *
f96e0b
 grub_lltoa (char *str, int c, unsigned long long n)
f96e0b
 {
f96e0b
-  unsigned base = (c == 'x') ? 16 : 10;
f96e0b
+  unsigned base = ((c == 'x') || (c == 'X')) ? 16 : 10;
f96e0b
   char *p;
f96e0b
 
f96e0b
   if ((long long) n < 0 && c == 'd')
f96e0b
@@ -611,7 +611,7 @@ grub_lltoa (char *str, int c, unsigned long long n)
f96e0b
     do
f96e0b
       {
f96e0b
 	unsigned d = (unsigned) (n & 0xf);
f96e0b
-	*p++ = (d > 9) ? d + 'a' - 10 : d + '0';
f96e0b
+	*p++ = (d > 9) ? d + ((c == 'x') ? 'a' : 'A') - 10 : d + '0';
f96e0b
       }
f96e0b
     while (n >>= 4);
f96e0b
   else
f96e0b
@@ -702,6 +702,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a
f96e0b
 	{
f96e0b
 	case 'p':
f96e0b
 	case 'x':
f96e0b
+	case 'X':
f96e0b
 	case 'u':
f96e0b
 	case 'd':
f96e0b
 	case 'c':
f96e0b
@@ -780,6 +781,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a
f96e0b
       switch (c)
f96e0b
 	{
f96e0b
 	case 'x':
f96e0b
+	case 'X':
f96e0b
 	case 'u':
f96e0b
 	case 'd':
f96e0b
 	  if (longlongfmt)
f96e0b
@@ -921,6 +923,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a
f96e0b
 	  longlongfmt |= (sizeof (void *) == sizeof (long long));
f96e0b
 	  /* Fall through. */
f96e0b
 	case 'x':
f96e0b
+	case 'X':
f96e0b
 	case 'u':
f96e0b
 	  unsig = 1;
f96e0b
 	  /* Fall through. */
f96e0b
-- 
f96e0b
1.8.2.1
f96e0b