Resolves: #1577872 - date, ls: pick strftime fixes from glibc to improve locale support
This commit is contained in:
parent
dd90a0a24b
commit
79b09b54df
101
coreutils-8.29-gnulib-strftime.patch
Normal file
101
coreutils-8.29-gnulib-strftime.patch
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
From 67defe5a29936c20a2c102b1b947ce9ea9afc081 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
Date: Tue, 23 Jan 2018 00:42:04 -0800
|
||||||
|
Subject: [PATCH] Merge strftime.c changes from glibc
|
||||||
|
|
||||||
|
This incorporates:
|
||||||
|
2017-11-14 [BZ #10871] Implement alternative month names
|
||||||
|
2017-11-14 [BZ #10871] Abbreviated alternative month names (%Ob)
|
||||||
|
2017-06-20 Use locale_t, not __locale_t, throughout glibc
|
||||||
|
* lib/nstrftime.c (ABALTMON_1) [!COMPILE_WIDE]: New macro.
|
||||||
|
(LOCALE_PARAM) [_LIBC && USE_IN_EXTENDED_LOCALE_MODEL]:
|
||||||
|
Use locale_t, not __locale_t.
|
||||||
|
(a_altmonth, f_altmonth, aam_len) [_NL_CURRENT]: New macros.
|
||||||
|
(__strftime_internal): Add support for alternate months.
|
||||||
|
|
||||||
|
Upstream-commit: 4a236f16ce0ef97094ff2f6538d4dba90e72a523
|
||||||
|
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
||||||
|
---
|
||||||
|
lib/nstrftime.c | 24 +++++++++++++++++++-----
|
||||||
|
1 file changed, 19 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/lib/nstrftime.c b/lib/nstrftime.c
|
||||||
|
index 8795cd7..5902c49 100644
|
||||||
|
--- a/lib/nstrftime.c
|
||||||
|
+++ b/lib/nstrftime.c
|
||||||
|
@@ -91,6 +91,7 @@ extern char *tzname[];
|
||||||
|
# define UCHAR_T unsigned char
|
||||||
|
# define L_(Str) Str
|
||||||
|
# define NLW(Sym) Sym
|
||||||
|
+# define ABALTMON_1 _NL_ABALTMON_1
|
||||||
|
|
||||||
|
# define MEMCPY(d, s, n) memcpy (d, s, n)
|
||||||
|
# define STRLEN(s) strlen (s)
|
||||||
|
@@ -255,7 +256,7 @@ extern char *tzname[];
|
||||||
|
# undef _NL_CURRENT
|
||||||
|
# define _NL_CURRENT(category, item) \
|
||||||
|
(current->values[_NL_ITEM_INDEX (item)].string)
|
||||||
|
-# define LOCALE_PARAM , __locale_t loc
|
||||||
|
+# define LOCALE_PARAM , locale_t loc
|
||||||
|
# define LOCALE_ARG , loc
|
||||||
|
# define HELPER_LOCALE_ARG , current
|
||||||
|
#else
|
||||||
|
@@ -475,12 +476,19 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
|
||||||
|
# define f_month \
|
||||||
|
((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11 \
|
||||||
|
? "?" : _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon)))
|
||||||
|
+# define a_altmonth \
|
||||||
|
+ ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11 \
|
||||||
|
+ ? "?" : _NL_CURRENT (LC_TIME, NLW(ABALTMON_1) + tp->tm_mon)))
|
||||||
|
+# define f_altmonth \
|
||||||
|
+ ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11 \
|
||||||
|
+ ? "?" : _NL_CURRENT (LC_TIME, NLW(ALTMON_1) + tp->tm_mon)))
|
||||||
|
# define ampm \
|
||||||
|
((const CHAR_T *) _NL_CURRENT (LC_TIME, tp->tm_hour > 11 \
|
||||||
|
? NLW(PM_STR) : NLW(AM_STR)))
|
||||||
|
|
||||||
|
# define aw_len STRLEN (a_wkday)
|
||||||
|
# define am_len STRLEN (a_month)
|
||||||
|
+# define aam_len STRLEN (a_altmonth)
|
||||||
|
# define ap_len STRLEN (ampm)
|
||||||
|
#endif
|
||||||
|
#if HAVE_TZNAME
|
||||||
|
@@ -808,17 +816,20 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
|
||||||
|
to_uppcase = true;
|
||||||
|
to_lowcase = false;
|
||||||
|
}
|
||||||
|
- if (modifier != 0)
|
||||||
|
+ if (modifier == L_('E'))
|
||||||
|
goto bad_format;
|
||||||
|
#ifdef _NL_CURRENT
|
||||||
|
- cpy (am_len, a_month);
|
||||||
|
+ if (modifier == L_('O'))
|
||||||
|
+ cpy (aam_len, a_altmonth);
|
||||||
|
+ else
|
||||||
|
+ cpy (am_len, a_month);
|
||||||
|
break;
|
||||||
|
#else
|
||||||
|
goto underlying_strftime;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
case L_('B'):
|
||||||
|
- if (modifier != 0)
|
||||||
|
+ if (modifier == L_('E'))
|
||||||
|
goto bad_format;
|
||||||
|
if (change_case)
|
||||||
|
{
|
||||||
|
@@ -826,7 +837,10 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
|
||||||
|
to_lowcase = false;
|
||||||
|
}
|
||||||
|
#ifdef _NL_CURRENT
|
||||||
|
- cpy (STRLEN (f_month), f_month);
|
||||||
|
+ if (modifier == L_('O'))
|
||||||
|
+ cpy (STRLEN (f_altmonth), f_altmonth);
|
||||||
|
+ else
|
||||||
|
+ cpy (STRLEN (f_month), f_month);
|
||||||
|
break;
|
||||||
|
#else
|
||||||
|
goto underlying_strftime;
|
||||||
|
--
|
||||||
|
2.14.3
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
Summary: A set of basic GNU tools commonly used in shell scripts
|
Summary: A set of basic GNU tools commonly used in shell scripts
|
||||||
Name: coreutils
|
Name: coreutils
|
||||||
Version: 8.29
|
Version: 8.29
|
||||||
Release: 10%{?dist}
|
Release: 11%{?dist}
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
Url: https://www.gnu.org/software/coreutils/
|
Url: https://www.gnu.org/software/coreutils/
|
||||||
@ -27,6 +27,9 @@ Patch3: coreutils-8.29-gnulib-fflush.patch
|
|||||||
# fix crash caused by mistakenly enabled leaf optimization (#1558249)
|
# fix crash caused by mistakenly enabled leaf optimization (#1558249)
|
||||||
Patch4: coreutils-8.29-fts-leaf-opt.patch
|
Patch4: coreutils-8.29-fts-leaf-opt.patch
|
||||||
|
|
||||||
|
# date, ls: pick strftime fixes from glibc to improve locale support (#1577872)
|
||||||
|
Patch5: coreutils-8.29-gnulib-strftime.patch
|
||||||
|
|
||||||
# disable the test-lock gnulib test prone to deadlock
|
# disable the test-lock gnulib test prone to deadlock
|
||||||
Patch100: coreutils-8.26-test-lock.patch
|
Patch100: coreutils-8.26-test-lock.patch
|
||||||
|
|
||||||
@ -277,6 +280,9 @@ fi
|
|||||||
%license COPYING
|
%license COPYING
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon May 28 2018 Kamil Dudka <kdudka@redhat.com> - 8.29-11
|
||||||
|
- date, ls: pick strftime fixes from glibc to improve locale support (#1577872)
|
||||||
|
|
||||||
* Fri Apr 20 2018 Kamil Dudka <kdudka@redhat.com> - 8.29-10
|
* Fri Apr 20 2018 Kamil Dudka <kdudka@redhat.com> - 8.29-10
|
||||||
- fix crash caused by mistakenly enabled leaf optimization (#1558249)
|
- fix crash caused by mistakenly enabled leaf optimization (#1558249)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user