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

Brian C. Lane bcl at redhat.com
Thu Feb 2 01:43:14 UTC 2017


On Tue, Jan 31, 2017 at 01:51:46PM -0500, Phillip Susi wrote:
> 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
> 
> 

ACK

-- 
Brian C. Lane (PST8PDT)



More information about the parted-devel mailing list