]> git.pld-linux.org Git - packages/parted.git/blob - 0072-parted-ui-remove-unneccesary-information-of-command-.patch
- rel 4; tons of patches from FC
[packages/parted.git] / 0072-parted-ui-remove-unneccesary-information-of-command-.patch
1 From eb5eb44f6ef009c68cc8867e3277fa832cad7f10 Mon Sep 17 00:00:00 2001
2 From: Wang Dong <dongdwdw@linux.vnet.ibm.com>
3 Date: Fri, 24 Mar 2017 03:11:10 +0100
4 Subject: [PATCH 72/75] parted/ui: remove unneccesary information of command
5  line
6
7 When some command fails, the information still exists in
8 command_line buffer. When in command mode or interactive mode,
9 if an interactive exception prompts, the remained information
10 will be processed as option from user. This will raise some other
11 information or even unexpected results. So before getting option
12 input from user, clean the command line buffer.
13
14 Example: When the disk label is invalid and user tries to make
15          new partition on the device with command like,
16          mkpart 0 50%. Then parted will raise an exception
17          telling an invalid disk label found and whether to correct it.
18          But at this time 0 as the input of mkpart will be
19          considered as the option input for the exception(yes/no).
20          So one more exception will raised with error information.
21
22 Signed-off-by: Wang Dong <dongdwdw@linux.vnet.ibm.com>
23 Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
24 ---
25  parted/ui.c | 1 +
26  1 file changed, 1 insertion(+)
27
28 diff --git a/parted/ui.c b/parted/ui.c
29 index 505b8ac..c603ed2 100644
30 --- a/parted/ui.c
31 +++ b/parted/ui.c
32 @@ -1270,6 +1270,7 @@ command_line_get_ex_opt (const char* prompt, PedExceptionOption options)
33          PedExceptionOption    opt;
34          char*                 opt_name;
35  
36 +        command_line_flush ();
37          for (opt = option_get_next (options, 0); opt;
38               opt = option_get_next (options, opt)) {
39                  options_strlist = str_list_append_unique (options_strlist,
40 -- 
41 2.9.3
42
This page took 0.093602 seconds and 3 git commands to generate.