Blame SOURCES/0077-Fix-failing-printf-test.patch

f96e0b
From 36cf49ba9881811dec77be5564bf001b2667220b Mon Sep 17 00:00:00 2001
f96e0b
From: Colin Watson <cjwatson@ubuntu.com>
f96e0b
Date: Wed, 2 Jan 2013 12:48:31 +0000
f96e0b
Subject: [PATCH 077/482] Fix failing printf test.
f96e0b
f96e0b
* grub-core/kern/misc.c (grub_vsnprintf_real): Parse '-', '.', and
f96e0b
'$' in the correct order when collecting type information.
f96e0b
---
f96e0b
 ChangeLog             |  7 +++++++
f96e0b
 grub-core/kern/misc.c | 17 ++++++++++-------
f96e0b
 2 files changed, 17 insertions(+), 7 deletions(-)
f96e0b
f96e0b
diff --git a/ChangeLog b/ChangeLog
f96e0b
index 68920bf..bb263f2 100644
f96e0b
--- a/ChangeLog
f96e0b
+++ b/ChangeLog
f96e0b
@@ -1,5 +1,12 @@
f96e0b
 2013-01-02  Colin Watson  <cjwatson@ubuntu.com>
f96e0b
 
f96e0b
+	Fix failing printf test.
f96e0b
+
f96e0b
+	* grub-core/kern/misc.c (grub_vsnprintf_real): Parse '-', '.', and
f96e0b
+	'$' in the correct order when collecting type information.
f96e0b
+
f96e0b
+2013-01-02  Colin Watson  <cjwatson@ubuntu.com>
f96e0b
+
f96e0b
 	* docs/grub.texi (configfile): Explain environment variable
f96e0b
 	handling.
f96e0b
 	(source): New section.
f96e0b
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
f96e0b
index 95d4624..c3203a0 100644
f96e0b
--- a/grub-core/kern/misc.c
f96e0b
+++ b/grub-core/kern/misc.c
f96e0b
@@ -741,23 +741,26 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a
f96e0b
       if (*fmt && *fmt =='-')
f96e0b
 	fmt++;
f96e0b
 
f96e0b
-      while (*fmt && grub_isdigit (*fmt))
f96e0b
-	fmt++;
f96e0b
-
f96e0b
-      if (*fmt && *fmt =='.')
f96e0b
-	fmt++;
f96e0b
+      p = fmt;
f96e0b
 
f96e0b
       while (*fmt && grub_isdigit (*fmt))
f96e0b
 	fmt++;
f96e0b
 
f96e0b
-      p = fmt;
f96e0b
-
f96e0b
       if (*fmt && *fmt == '$')
f96e0b
 	{
f96e0b
 	  curn = grub_strtoull (p, 0, 10) - 1;
f96e0b
 	  fmt++;
f96e0b
 	}
f96e0b
 
f96e0b
+      if (*fmt && *fmt =='-')
f96e0b
+	fmt++;
f96e0b
+
f96e0b
+      while (*fmt && grub_isdigit (*fmt))
f96e0b
+	fmt++;
f96e0b
+
f96e0b
+      if (*fmt && *fmt =='.')
f96e0b
+	fmt++;
f96e0b
+
f96e0b
       while (*fmt && grub_isdigit (*fmt))
f96e0b
 	fmt++;
f96e0b
 
f96e0b
-- 
f96e0b
1.8.2.1
f96e0b