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