[parted-devel] [PATCH 1/3] libparted: Fix part dupe with empty name

Brian C. Lane bcl at redhat.com
Wed Jun 11 19:13:48 UTC 2014


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




More information about the parted-devel mailing list