parted/0123-libparted-Fix-part-dupe-with-empty-name.patch
Brian C. Lane 73aa139585 - Rebase on parted master commit 1da239e2ebd2
- libparted: Fix bug with dupe and empty name
2014-06-13 09:52:56 -07:00

34 lines
1013 B
Diff

From f688c5a7910e1e5f81e8bd0e48a9ed64ec6b2a47 Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Wed, 16 Apr 2014 18:18:38 -0700
Subject: [PATCH 123/125] libparted: Fix part dupe with empty name
It was setting the original translated_name to 0, not the new copy.
* libparted/labels/gpt.c (gpt_partition_duplicate): fix empty name
---
libparted/labels/gpt.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index 2a08a50..d69377a 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -1407,9 +1407,11 @@ gpt_partition_duplicate (const PedPartition *part)
goto error_free_part;
*result_data = *part_data;
- if (part_data->translated_name)
+ if (part_data->translated_name) {
result_data->translated_name = xstrdup (part_data->translated_name);
- else part_data->translated_name = 0;
+ } else {
+ result_data->translated_name = 0;
+ }
return result;
error_free_part:
--
1.9.3