Blame SOURCES/0072-parted-ui-remove-unneccesary-information-of-command-.patch

003ee8
From eb5eb44f6ef009c68cc8867e3277fa832cad7f10 Mon Sep 17 00:00:00 2001
003ee8
From: Wang Dong <dongdwdw@linux.vnet.ibm.com>
003ee8
Date: Fri, 24 Mar 2017 03:11:10 +0100
003ee8
Subject: [PATCH 72/75] parted/ui: remove unneccesary information of command
003ee8
 line
003ee8
003ee8
When some command fails, the information still exists in
003ee8
command_line buffer. When in command mode or interactive mode,
003ee8
if an interactive exception prompts, the remained information
003ee8
will be processed as option from user. This will raise some other
003ee8
information or even unexpected results. So before getting option
003ee8
input from user, clean the command line buffer.
003ee8
003ee8
Example: When the disk label is invalid and user tries to make
003ee8
	 new partition on the device with command like,
003ee8
	 mkpart 0 50%. Then parted will raise an exception
003ee8
	 telling an invalid disk label found and whether to correct it.
003ee8
	 But at this time 0 as the input of mkpart will be
003ee8
	 considered as the option input for the exception(yes/no).
003ee8
	 So one more exception will raised with error information.
003ee8
003ee8
Signed-off-by: Wang Dong <dongdwdw@linux.vnet.ibm.com>
003ee8
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
003ee8
---
003ee8
 parted/ui.c | 1 +
003ee8
 1 file changed, 1 insertion(+)
003ee8
003ee8
diff --git a/parted/ui.c b/parted/ui.c
003ee8
index 505b8ac..c603ed2 100644
003ee8
--- a/parted/ui.c
003ee8
+++ b/parted/ui.c
003ee8
@@ -1270,6 +1270,7 @@ command_line_get_ex_opt (const char* prompt, PedExceptionOption options)
003ee8
         PedExceptionOption    opt;
003ee8
         char*                 opt_name;
003ee8
 
003ee8
+        command_line_flush ();
003ee8
         for (opt = option_get_next (options, 0); opt;
003ee8
              opt = option_get_next (options, opt)) {
003ee8
                 options_strlist = str_list_append_unique (options_strlist,
003ee8
-- 
003ee8
2.9.3
003ee8