View | Details | Raw Unified | Return to bug 10871 | Differences between
and this patch

Collapse All | Expand All

(-)a/time/strftime_l.c (-2 / +10 lines)
Lines 492-497 __strftime_internal (CHAR_T *s, size_t maxsize, const CHAR_T *format, Link Here
492
# define f_month \
492
# define f_month \
493
  ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11			     \
493
  ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11			     \
494
		     ? "?" : _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon)))
494
		     ? "?" : _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon)))
495
# define f_altmonth \
496
  ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11			     \
497
		     ? "?" : _NL_CURRENT (LC_TIME, NLW(ALTMON_1) + tp->tm_mon)))
495
# define ampm \
498
# define ampm \
496
  ((const CHAR_T *) _NL_CURRENT (LC_TIME, tp->tm_hour > 11		      \
499
  ((const CHAR_T *) _NL_CURRENT (LC_TIME, tp->tm_hour > 11		      \
497
				 ? NLW(PM_STR) : NLW(AM_STR)))
500
				 ? NLW(PM_STR) : NLW(AM_STR)))
Lines 507-512 __strftime_internal (CHAR_T *s, size_t maxsize, const CHAR_T *format, Link Here
507
		   ? "?" : month_name[tp->tm_mon])
510
		   ? "?" : month_name[tp->tm_mon])
508
#  define a_wkday f_wkday
511
#  define a_wkday f_wkday
509
#  define a_month f_month
512
#  define a_month f_month
513
#  define f_altmonth (L_(""))
510
#  define ampm (L_("AMPM") + 2 * (tp->tm_hour > 11))
514
#  define ampm (L_("AMPM") + 2 * (tp->tm_hour > 11))
511
515
512
  size_t aw_len = 3;
516
  size_t aw_len = 3;
Lines 775-781 __strftime_internal (CHAR_T *s, size_t maxsize, const CHAR_T *format, Link Here
775
#endif
779
#endif
776
780
777
	case L_('B'):
781
	case L_('B'):
778
	  if (modifier != 0)
782
	  if (modifier == L_('E'))
779
	    goto bad_format;
783
	    goto bad_format;
780
	  if (change_case)
784
	  if (change_case)
781
	    {
785
	    {
Lines 783-789 __strftime_internal (CHAR_T *s, size_t maxsize, const CHAR_T *format, Link Here
783
	      to_lowcase = 0;
787
	      to_lowcase = 0;
784
	    }
788
	    }
785
#if defined _NL_CURRENT || !HAVE_STRFTIME
789
#if defined _NL_CURRENT || !HAVE_STRFTIME
786
	  cpy (STRLEN (f_month), f_month);
790
	  /* Use f_altmonth only if f_altmonth is provided.  */
791
	  if (f_altmonth[0] && modifier == L_('O'))
792
	    cpy (STRLEN (f_altmonth), f_altmonth);
793
	  else
794
	    cpy (STRLEN (f_month), f_month);
787
	  break;
795
	  break;
788
#else
796
#else
789
	  goto underlying_strftime;
797
	  goto underlying_strftime;
(-)a/time/strptime_l.c (-1 / +28 lines)
Lines 124-129 extern const struct __locale_data _nl_C_LC_TIME attribute_hidden; Link Here
124
  (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (ABDAY_1)].string)
124
  (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (ABDAY_1)].string)
125
# define month_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (MON_1)].string)
125
# define month_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (MON_1)].string)
126
# define ab_month_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (ABMON_1)].string)
126
# define ab_month_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (ABMON_1)].string)
127
# define alt_month_name \
128
  (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (ALTMON_1)].string)
127
# define HERE_D_T_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (D_T_FMT)].string)
129
# define HERE_D_T_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (D_T_FMT)].string)
128
# define HERE_D_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (D_FMT)].string)
130
# define HERE_D_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (D_FMT)].string)
129
# define HERE_AM_STR (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (AM_STR)].string)
131
# define HERE_AM_STR (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (AM_STR)].string)
Lines 403-408 __strptime_internal (const char *rp, const char *fmt, struct tm *tmp, Link Here
403
	      if (s.decided !=raw)
405
	      if (s.decided !=raw)
404
		{
406
		{
405
		  trp = rp;
407
		  trp = rp;
408
#ifdef _LIBC
409
		  /* First check if the alt month is provided.  */
410
		  if (_NL_CURRENT (LC_TIME, ALTMON_1 + cnt)
411
		      && * (_NL_CURRENT (LC_TIME, ALTMON_1 + cnt))
412
		      && match_string (_NL_CURRENT (LC_TIME, ALTMON_1 + cnt), trp)
413
		      && trp > rp_longest)
414
		    {
415
		      rp_longest = trp;
416
		      cnt_longest = cnt;
417
		      if (s.decided == not
418
			  && strcmp (_NL_CURRENT (LC_TIME, ALTMON_1 + cnt),
419
				     alt_month_name[cnt]))
420
			decided_longest = loc;
421
		    }
422
		  trp = rp;
423
#endif
406
		  if (match_string (_NL_CURRENT (LC_TIME, MON_1 + cnt), trp)
424
		  if (match_string (_NL_CURRENT (LC_TIME, MON_1 + cnt), trp)
407
		      && trp > rp_longest)
425
		      && trp > rp_longest)
408
		    {
426
		    {
Lines 429-434 __strptime_internal (const char *rp, const char *fmt, struct tm *tmp, Link Here
429
	      if (s.decided != loc
447
	      if (s.decided != loc
430
		  && (((trp = rp, match_string (month_name[cnt], trp))
448
		  && (((trp = rp, match_string (month_name[cnt], trp))
431
		       && trp > rp_longest)
449
		       && trp > rp_longest)
450
#ifdef _LIBC
451
		      || ((trp = rp, alt_month_name[cnt]
452
			  && alt_month_name[cnt][0]
453
			  && match_string (alt_month_name[cnt], trp))
454
			  && trp > rp_longest)
455
#endif
432
		      || ((trp = rp, match_string (ab_month_name[cnt], trp))
456
		      || ((trp = rp, match_string (ab_month_name[cnt], trp))
433
			  && trp > rp_longest)))
457
			  && trp > rp_longest)))
434
		{
458
		{
Lines 1016-1021 __strptime_internal (const char *rp, const char *fmt, struct tm *tmp, Link Here
1016
	case 'O':
1040
	case 'O':
1017
	  switch (*fmt++)
1041
	  switch (*fmt++)
1018
	    {
1042
	    {
1043
	    case 'B':
1044
	      /* Undo the increment and continue.  */
1045
	      fmt--;
1046
	      break;
1019
	    case 'd':
1047
	    case 'd':
1020
	    case 'e':
1048
	    case 'e':
1021
	      /* Match day of month using alternate numeric symbols.  */
1049
	      /* Match day of month using alternate numeric symbols.  */
1022
- 

Return to bug 10871