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

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