This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC][PATCH v2 0/6][BZ 10871] Month names in genitive case


This is the second version of my attempt to fix the bug 10871. [1]
The previous version has been sent to this list in January. [2]

The main difference between the old set of patches and this new one
is that I completely misunderstood [3] the POSIX [4] definition
of the alternative vs. regular month names and the meaning of %OB format
specifier in strftime.  It turns out there are no differences between
POSIX and *BSD [5] specification so there is no reason to search for
any other solution.

Here is a short description of the following patches:

1. Add the alternative month names support to nl_langinfo(3) (the
ALTMON_... constants.)  The differences between the previous [6] version
and this one are:
- alternative month names defined (hardcoded) as the empty strings
  in the C locale, otherwise it crashed when falling back to the C locale
  (for example the missing or incorrect locales);
- loading locales changed: the locale category size is verified correctly,
  otherwise raised a falsely positive warning and caused whole category
  to be rejected just because the alternative months array is added at
  the end of the category definition; see also: [7];
- comments changed: from now MON_... constants are for the genitive month
  names and ALTMON_... for the nominative cases (applies only to the
  languages which need to distinguish), previously MON_... constants were
  nominative and ALTMON_... did not exist.

2. Actually the same as [8], the only difference is the Subject line
which says it's PATCH 2/6 rather than 2/7;

(Note: we no longer need the day-month order hint [9] since we will specify
whether we need a nominative or genitive case explicitly with %OB or %B
format specifier, respectively.)

3. Implement the %OB specifier.  Much simpler than the old version [10]
because we no longer need a smart algorithm determining whether we need
a nominative or a genitive case.  strptime() implementation has been
changed according to Mike's note [11]: we don't use alt_month_name array
if we compile options do not want locales, therefore we don't need to
define the array which is the same as month_name just to please a compiler.
Also it handles %OB format specifier correctly.

4. Alternative month names NLS data (Polish).  As previously, feel free
to use this patch only for local tests and reject it from the public
repository. However, please note that you need some NLS data with the
alternative month names, otherwise you will not see any effect of the
previous patches.  The main difference between the old version [12]
and this patch is that the meaning of mon and alt_mon are swapped and we
no longer need a day-month order hint.

5. Alternative month names NLS data (Russian).  The differences between
the old version [13] and this patch are the same as above.

6. Alternative month names NLS data (Ukrainian).  The differences between
the old version [14] and this patch are the same as above.

I'll appreciate your reviews and comments.

Best regards,

Rafal Luzynski

 [1] https://sourceware.org/bugzilla/show_bug.cgi?id=10871
 [2] https://sourceware.org/ml/libc-alpha/2016-01/msg00143.html
 [3] https://sourceware.org/bugzilla/show_bug.cgi?id=10871#c39
 [4] http://austingroupbugs.net/view.php?id=258
 [5] https://www.freebsd.org/cgi/man.cgi?query=strftime&sektion=3
 [6] https://sourceware.org/ml/libc-alpha/2016-01/msg00144.html
 [7] https://sourceware.org/ml/libc-alpha/2016-03/msg00521.html
 [8] https://sourceware.org/ml/libc-alpha/2016-01/msg00145.html
 [9] https://sourceware.org/ml/libc-alpha/2016-01/msg00146.html
[10] https://sourceware.org/ml/libc-alpha/2016-01/msg00147.html
[11] https://sourceware.org/ml/libc-alpha/2016-01/msg00152.html
[12] https://sourceware.org/ml/libc-alpha/2016-01/msg00148.html
[13] https://sourceware.org/ml/libc-alpha/2016-01/msg00149.html
[14] https://sourceware.org/ml/libc-alpha/2016-01/msg00150.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]