From patchwork Sat Aug 29 20:39:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 8511 X-Patchwork-Delegate: vapier@gentoo.org Received: (qmail 80872 invoked by alias); 29 Aug 2015 20:40:01 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 80834 invoked by uid 89); 29 Aug 2015 20:40:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org From: Mike Frysinger To: libc-alpha@sourceware.org Subject: [PATCH] localedef: improve error message [BZ #16985] Date: Sat, 29 Aug 2015 16:39:53 -0400 Message-Id: <1440880793-32082-1-git-send-email-vapier@gentoo.org> 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 [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); }