apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 56030] New: give getopt error codes for localisation
Date Sat, 18 Jan 2014 14:50:39 GMT

            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

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

View raw message