forked from pool/parted
Accepting request 718780 from Base:System
OBS-URL: https://build.opensuse.org/request/show/718780 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/parted?expand=0&rev=128
This commit is contained in:
commit
b61e5dcb7c
@ -23,10 +23,10 @@ Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
|
|||||||
parted/ui.c | 26 ++++++++++++++++++++++----
|
parted/ui.c | 26 ++++++++++++++++++++++----
|
||||||
1 file changed, 22 insertions(+), 4 deletions(-)
|
1 file changed, 22 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
diff --git a/parted/ui.c b/parted/ui.c
|
Index: parted-3.2/parted/ui.c
|
||||||
index 505b8ac..5d76c20 100644
|
===================================================================
|
||||||
--- a/parted/ui.c
|
--- parted-3.2.orig/parted/ui.c
|
||||||
+++ b/parted/ui.c
|
+++ parted-3.2/parted/ui.c
|
||||||
@@ -29,6 +29,8 @@
|
@@ -29,6 +29,8 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
@ -36,7 +36,7 @@ index 505b8ac..5d76c20 100644
|
|||||||
|
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "strlist.h"
|
#include "strlist.h"
|
||||||
@@ -909,16 +911,30 @@ command_line_get_integer (const char* prompt, int* value)
|
@@ -912,16 +914,34 @@ command_line_get_integer (const char* pr
|
||||||
{
|
{
|
||||||
char def_str [10];
|
char def_str [10];
|
||||||
char* input;
|
char* input;
|
||||||
@ -51,7 +51,11 @@ index 505b8ac..5d76c20 100644
|
|||||||
- valid = sscanf (input, "%d", value);
|
- valid = sscanf (input, "%d", value);
|
||||||
+
|
+
|
||||||
+ errno = 0;
|
+ errno = 0;
|
||||||
+ ret = strtol (input, (char**) NULL, 0);
|
+
|
||||||
|
+ if (strstr(input, "0x") == input)
|
||||||
|
+ ret = strtol (input, (char**) NULL, 16);
|
||||||
|
+ else
|
||||||
|
+ ret = strtol (input, (char**) NULL, 10);
|
||||||
+ if (errno)
|
+ if (errno)
|
||||||
+ goto error;
|
+ goto error;
|
||||||
+
|
+
|
||||||
@ -70,7 +74,7 @@ index 505b8ac..5d76c20 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@@ -1029,6 +1045,7 @@ command_line_get_partition (const char* prompt, PedDisk* disk,
|
@@ -1031,6 +1051,7 @@ command_line_get_partition (const char*
|
||||||
PedPartition** value)
|
PedPartition** value)
|
||||||
{
|
{
|
||||||
PedPartition* part;
|
PedPartition* part;
|
||||||
@ -78,7 +82,7 @@ index 505b8ac..5d76c20 100644
|
|||||||
|
|
||||||
/* Flawed logic, doesn't seem to work?!
|
/* Flawed logic, doesn't seem to work?!
|
||||||
check = ped_disk_next_partition (disk, part);
|
check = ped_disk_next_partition (disk, part);
|
||||||
@@ -1045,7 +1062,8 @@ command_line_get_partition (const char* prompt, PedDisk* disk,
|
@@ -1047,7 +1068,8 @@ command_line_get_partition (const char*
|
||||||
*/
|
*/
|
||||||
int num = (*value) ? (*value)->num : 0;
|
int num = (*value) ? (*value)->num : 0;
|
||||||
|
|
||||||
@ -88,6 +92,3 @@ index 505b8ac..5d76c20 100644
|
|||||||
ped_exception_throw (PED_EXCEPTION_ERROR,
|
ped_exception_throw (PED_EXCEPTION_ERROR,
|
||||||
PED_EXCEPTION_CANCEL,
|
PED_EXCEPTION_CANCEL,
|
||||||
_("Expecting a partition number."));
|
_("Expecting a partition number."));
|
||||||
--
|
|
||||||
2.16.4
|
|
||||||
|
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jul 10 10:16:16 UTC 2019 - Anna Maresova <anicka@suse.com>
|
||||||
|
|
||||||
|
- changed: parted-fix-crash-due-to-improper-partition-number-in.patch
|
||||||
|
Changed the patch to behave in the same way like before last change
|
||||||
|
for numbers with leading zeroes.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jul 1 14:14:36 UTC 2019 - Anna Maresova <anicka@suse.com>
|
Mon Jul 1 14:14:36 UTC 2019 - Anna Maresova <anicka@suse.com>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user