This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] localedef: improve error message [BZ #16985]
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 11 Sep 2015 11:38:16 -0700
- Subject: Re: [PATCH] localedef: improve error message [BZ #16985]
- Authentication-results: sourceware.org; auth=none
- References: <1440880793-32082-1-git-send-email-vapier at gentoo dot org>
On Sat, Aug 29, 2015 at 1:39 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> If you pass in a path that fails to be opened, then output_path is set to
> NULL, and an error is flagged. Then at the end, we use both of those:
> cannot write output files to `(null)': No such file or directory
>
> Tweak the message to use the user's input when output_path is NULL.
>
> 2015-08-29 Mike Frysinger <vapier@gentoo.org>
>
> [BZ #16985]
> * programs/localedef.c (main): Display argv[remaining] when
> output_path is NULL.
> ---
> locale/programs/localedef.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c
> index 2a0f2aa..06fca12 100644
> --- a/locale/programs/localedef.c
> +++ b/locale/programs/localedef.c
> @@ -286,7 +286,7 @@ cannot open locale definition file `%s'"), runp->name));
> {
> if (cannot_write_why != 0)
> WITH_CUR_LOCALE (error (4, cannot_write_why, _("\
> -cannot write output files to `%s'"), output_path));
> +cannot write output files to `%s'"), output_path ? : argv[remaining]));
> else
> write_all_categories (locales, charmap, argv[remaining], output_path);
> }
Looks good to me.
Thanks.
--
H.J.