[parted-devel] [PATCH] Fix crash when localized

Phillip Susi psusi at ubuntu.com
Tue Feb 2 20:07:15 UTC 2016


The _() macro is only for translating string literals.  It was
incorrectly applied to a runtime string representing the name
of a partition and this sometimes caused a gettext crash.
---
 NEWS            | 1 +
 parted/parted.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 96135ed..1e7839e 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ GNU parted NEWS                                    -*- outline -*-
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
 ** Bug Fixes
+  Fix a gettext crash/error sometimes when using localized languages.
 
   Use 512b sector size when communicating with device-mapper. Fixes
   problems with partitions being created too small on dm devices
diff --git a/parted/parted.c b/parted/parted.c
index a9426c4..e4b51a8 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -1269,7 +1269,7 @@ do_print (PedDevice** dev, PedDisk** diskp)
                         putchar (':');
 
                     if (has_name)
-                        printf ("%s:", _(ped_partition_get_name (part)));
+                        printf ("%s:", ped_partition_get_name (part));
                     else
                         putchar (':');
 
-- 
1.9.1




More information about the parted-devel mailing list