Return-Path: X-Original-To: apmail-apr-bugs-archive@www.apache.org Delivered-To: apmail-apr-bugs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ADBD910C39 for ; Sat, 18 Jan 2014 14:51:09 +0000 (UTC) Received: (qmail 86279 invoked by uid 500); 18 Jan 2014 14:51:09 -0000 Delivered-To: apmail-apr-bugs-archive@apr.apache.org Received: (qmail 86229 invoked by uid 500); 18 Jan 2014 14:51:04 -0000 Mailing-List: contact bugs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@apr.apache.org Delivered-To: mailing list bugs@apr.apache.org Received: (qmail 86221 invoked by uid 99); 18 Jan 2014 14:51:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Jan 2014 14:51:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.115] (HELO eir.zones.apache.org) (140.211.11.115) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Jan 2014 14:51:00 +0000 Received: by eir.zones.apache.org (Postfix, from userid 80) id CDC4C1CB72; Sat, 18 Jan 2014 14:50:40 +0000 (UTC) From: bugzilla@apache.org To: bugs@apr.apache.org Subject: [Bug 56030] New: give getopt error codes for localisation Date: Sat, 18 Jan 2014 14:50:39 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: APR X-Bugzilla-Component: APR X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mattiase@acm.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: bugs@apr.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=56030 Bug ID: 56030 Summary: give getopt error codes for localisation Product: APR Version: HEAD Hardware: All OS: All Status: NEW Severity: normal Priority: P2 Component: APR Assignee: bugs@apr.apache.org Reporter: mattiase@acm.org Created attachment 31227 --> https://issues.apache.org/bugzilla/attachment.cgi?id=31227&action=edit apr-getopt-error-code.patch The error messages of getopt are tricky to localise properly, since they are served as fprintf-like function invocations only. Since there is only very few distinct messages, the best solution is to introduce some sort of codes that the application can do whatever it wants with. Here is a patch that does exactly that. It is entirely source and, by virtue of a slightly sleazy hack, binary compatible. That hack can be eliminated if we get to break binary compatibility; source compatibility would still be retained. I'd suggest using the hack in 1.x and doing it cleanly (by adding a apr_getopt_t member) in 2.x. The getopt code is ancient and it shows: nobody would have exposed a struct like that in an API design today, but it's what we have to work with. Please review, and tell me if I should supply a commit message, CHANGES addition and so on. The patch is textually against trunk, although it contains the compatibility hack mentioned above only needed in 1.x. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org For additional commands, e-mail: bugs-help@apr.apache.org