You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2014/01/18 15:50:39 UTC

[Bug 56030] New: give getopt error codes for localisation

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


[Bug 56030] give getopt error codes for localisation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56030

Mattias EngdegÄrd <ma...@acm.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #31227|0                           |1
           is patch|                            |

--- Comment #1 from Mattias EngdegÄrd <ma...@acm.org> ---
Comment on attachment 31227
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31227
apr-getopt-error-code.patch

Attachment properly marked as patch in Bugzilla.

-- 
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