dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0069-Fix-grub-probe-0-option.patch

39700a
From fdf24f98bc9e4632bfe7f280872cbbf40942ae7b Mon Sep 17 00:00:00 2001
39700a
From: Colin Watson <cjwatson@ubuntu.com>
39700a
Date: Mon, 31 Mar 2014 13:51:17 +0100
39700a
Subject: [PATCH 069/143] Fix grub-probe -0 option
39700a
39700a
* util/grub-probe,c (options): Make -0 work again (broken by
39700a
conversion to argp).
39700a
(main): Simplify logic.
39700a
---
39700a
 ChangeLog         | 6 ++++++
39700a
 util/grub-probe.c | 7 ++-----
39700a
 2 files changed, 8 insertions(+), 5 deletions(-)
39700a
39700a
diff --git a/ChangeLog b/ChangeLog
39700a
index 9404eda..efbed8c 100644
39700a
--- a/ChangeLog
39700a
+++ b/ChangeLog
39700a
@@ -1,3 +1,9 @@
39700a
+2014-03-31  Colin Watson  <cjwatson@ubuntu.com>
39700a
+
39700a
+	* util/grub-probe,c (options): Make -0 work again (broken by
39700a
+	conversion to argp).
39700a
+	(main): Simplify logic.
39700a
+
39700a
 2014-03-26  Vladimir Serbinenko  <phcoder@gmail.com>
39700a
 
39700a
 	* grub-core/lib/relocator.c: Fix the case when end of leftover is used.
39700a
diff --git a/util/grub-probe.c b/util/grub-probe.c
39700a
index 1f3b59f..80509be 100644
39700a
--- a/util/grub-probe.c
39700a
+++ b/util/grub-probe.c
39700a
@@ -711,6 +711,7 @@ static struct argp_option options[] = {
39700a
    N_("use FILE as the device map [default=%s]"), 0},
39700a
   {"target",  't', N_("TARGET"), 0, 0, 0},
39700a
   {"verbose",     'v', 0,      0, N_("print verbose messages."), 0},
39700a
+  {0, '0', 0, 0, N_("separate items in output using ASCII NUL characters"), 0},
39700a
   { 0, 0, 0, 0, 0, 0 }
39700a
 };
39700a
 
39700a
@@ -884,11 +885,7 @@ main (int argc, char *argv[])
39700a
   else
39700a
     probe (arguments.devices[0], NULL, delim);
39700a
 
39700a
-  if (!arguments.zero_delim && (print == PRINT_BIOS_HINT
39700a
-				|| print == PRINT_IEEE1275_HINT
39700a
-				|| print == PRINT_BAREMETAL_HINT
39700a
-				|| print == PRINT_EFI_HINT
39700a
-				|| print == PRINT_ARC_HINT))
39700a
+  if (delim == ' ')
39700a
     putchar ('\n');
39700a
 
39700a
   /* Free resources.  */
39700a
-- 
39700a
1.9.3
39700a