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

Phillip Susi psusi at ubuntu.com
Tue Jan 31 18:51:46 UTC 2017


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 198b35d..5a8db48 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ GNU parted NEWS                                    -*- outline -*-
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
 ** Bug Fixes
+  Fix a gettext crash/error sometimes when using localized languages.
 
   Fix fat resize to preverve boot code, and thus not render the
   filesystem unreconized by Windows.
diff --git a/parted/parted.c b/parted/parted.c
index 7e6c266..a72a4eb 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -1276,7 +1276,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