This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [BZ#15395] localize rpcgen
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Andreas Jaeger <aj at suse dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Fri, 10 May 2013 08:44:21 +0530
- Subject: Re: [BZ#15395] localize rpcgen
- References: <518BBC5C dot 7090404 at suse dot com>
On Thu, May 09, 2013 at 05:10:20PM +0200, Andreas Jaeger wrote:
> rpcgen has the strings localized but never calls setlocale/textdomain.
>
> Fixed with the appended patch.
>
> Ok to commit?
> Andreas
>
> 2013-05-09 Andreas Jaeger <aj@suse.de>
>
> [BZ #15395]
> * sunrpc/rpc_main.c (main): Invoke setlocale and textdomain for
> localization.
> Include <locale.h>.
Looks good to me.
Thanks,
Siddhesh
> diff --git a/sunrpc/rpc_main.c b/sunrpc/rpc_main.c
> index 1477b43..d03ec99 100644
> --- a/sunrpc/rpc_main.c
> +++ b/sunrpc/rpc_main.c
> @@ -39,6 +39,7 @@
> #include <string.h>
> #include <unistd.h>
> #include <libintl.h>
> +#include <locale.h>
> #include <ctype.h>
> #include <sys/types.h>
> #include <sys/param.h>
> @@ -173,6 +174,9 @@ main (int argc, const char *argv[])
> {
> struct commandline cmd;
>
> + setlocale (LC_ALL, "");
> + textdomain (_libc_intl_domainname);
> +
> (void) memset ((char *) &cmd, 0, sizeof (struct commandline));
> clear_args ();
> if (!parseargs (argc, argv, &cmd))
>
> --
> Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
> GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126