[PATCH] localedef: improve error message [BZ #16985]
Mike Frysinger
vapier@gentoo.org
Fri Sep 11 18:24:00 GMT 2015
ping ...
-mike
On 29 Aug 2015 16:39, Mike Frysinger 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);
> }
> --
> 2.5.0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150911/f44589bd/attachment.sig>
More information about the Libc-alpha
mailing list