mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-07 06:43:00 +03:00
Update.
* time/strftime.c [emacs]: Define my_strftime to emacs_strftimeu. Define ut_argument, ut_argument_spec, and ut_argument_spec_iso to allow using `ut' parameter. [!emacs]: Define ut_argument, ut_argument_spec, and ut_argument_spec_iso as empty. Define ut to 0. Add ut_argument and argument_spec to prototypes and definitions. (my_strftime): Don't call tzset of ut != 0. Compute diff as 0 is ut != 0; [emacs]: Define new emacs_strftime function. Based on a patch by Paul Eggert. 1998-09-24 Paul Eggert <eggert@twinsun.com> * time/strftime.c (my_strftime): When asking for the length of the subformatted buffer, do not limit the length to look for; otherwise, we have no reliable way to distinguish between the empty buffer and an error. 1998-09-25 Ulrich Drepper <drepper@cygnus.com> * debug/catchsegv.sh: Also produce output if clone process died.
This commit is contained in:
22
ChangeLog
22
ChangeLog
@@ -1,3 +1,23 @@
|
||||
1998-09-25 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* time/strftime.c [emacs]: Define my_strftime to emacs_strftimeu.
|
||||
Define ut_argument, ut_argument_spec, and ut_argument_spec_iso to
|
||||
allow using `ut' parameter.
|
||||
[!emacs]: Define ut_argument, ut_argument_spec, and
|
||||
ut_argument_spec_iso as empty. Define ut to 0. Add ut_argument and
|
||||
argument_spec to prototypes and definitions.
|
||||
(my_strftime): Don't call tzset of ut != 0.
|
||||
Compute diff as 0 is ut != 0;
|
||||
[emacs]: Define new emacs_strftime function.
|
||||
Based on a patch by Paul Eggert.
|
||||
|
||||
1998-09-24 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* time/strftime.c (my_strftime): When asking for the length of the
|
||||
subformatted buffer, do not limit the length to look for;
|
||||
otherwise, we have no reliable way to distinguish between the
|
||||
empty buffer and an error.
|
||||
|
||||
1998-09-25 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* math/Makefile (gmp-objs): Add mp_clz_tab.
|
||||
@@ -25,7 +45,7 @@
|
||||
|
||||
1998-09-24 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* debug/catchsegv.sh: Also produce output if cloned process died.
|
||||
* debug/catchsegv.sh: Also produce output if clone process died.
|
||||
|
||||
1998-09-24 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
|
@@ -374,26 +374,35 @@ static char const month_name[][10] =
|
||||
|
||||
|
||||
#ifdef emacs
|
||||
# define my_strftime emacs_strftime
|
||||
# define my_strftime emacs_strftimeu
|
||||
# define ut_argument , ut
|
||||
# define ut_argument_spec int ut;
|
||||
# define ut_argument_spec_iso , int ut
|
||||
#else
|
||||
# define my_strftime strftime
|
||||
# define ut_argument
|
||||
# define ut_argument_spec
|
||||
# define ut_argument_spec_iso
|
||||
/* We don't have this information in general. */
|
||||
# define ut 0
|
||||
#endif
|
||||
|
||||
#if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET
|
||||
/* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
|
||||
Work around this bug by copying *tp before it might be munged. */
|
||||
size_t _strftime_copytm __P ((char *, size_t, const char *,
|
||||
const struct tm *));
|
||||
const struct tm * ut_argument_spec_iso));
|
||||
size_t
|
||||
my_strftime (s, maxsize, format, tp)
|
||||
my_strftime (s, maxsize, format, tp ut_argument)
|
||||
char *s;
|
||||
size_t maxsize;
|
||||
const char *format;
|
||||
const struct tm *tp;
|
||||
ut_argument_spec
|
||||
{
|
||||
struct tm tmcopy;
|
||||
tmcopy = *tp;
|
||||
return _strftime_copytm (s, maxsize, format, &tmcopy);
|
||||
return _strftime_copytm (s, maxsize, format, &tmcopy ut_argument);
|
||||
}
|
||||
# undef my_strftime
|
||||
# define my_strftime(S, Maxsize, Format, Tp) \
|
||||
@@ -408,11 +417,12 @@ static char const month_name[][10] =
|
||||
anywhere, so to determine how many characters would be
|
||||
written, use NULL for S and (size_t) UINT_MAX for MAXSIZE. */
|
||||
size_t
|
||||
my_strftime (s, maxsize, format, tp)
|
||||
my_strftime (s, maxsize, format, tp ut_argument)
|
||||
char *s;
|
||||
size_t maxsize;
|
||||
const char *format;
|
||||
const struct tm *tp;
|
||||
ut_argument_spec
|
||||
{
|
||||
int hour12 = tp->tm_hour;
|
||||
#ifdef _NL_CURRENT
|
||||
@@ -459,12 +469,22 @@ my_strftime (s, maxsize, format, tp)
|
||||
POSIX does not require it. Do the right thing instead. */
|
||||
zone = (const char *) tp->tm_zone;
|
||||
#endif
|
||||
#if HAVE_TZNAME && HAVE_TZSET
|
||||
#if HAVE_TZNAME
|
||||
if (ut)
|
||||
{
|
||||
if (! (zone && *zone))
|
||||
zone = "GMT";
|
||||
}
|
||||
else
|
||||
{
|
||||
/* POSIX.1 8.1.1 requires that whenever strftime() is called, the
|
||||
time zone names contained in the external variable `tzname' shall
|
||||
be set as if the tzset() function had been called. */
|
||||
# if HAVE_TZSET
|
||||
tzset ();
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
if (hour12 > 12)
|
||||
hour12 -= 12;
|
||||
@@ -713,9 +733,7 @@ my_strftime (s, maxsize, format, tp)
|
||||
subformat:
|
||||
{
|
||||
char *old_start = p;
|
||||
size_t len = my_strftime (NULL, maxsize - i, subfmt, tp);
|
||||
if (len == 0 && *subfmt)
|
||||
return 0;
|
||||
size_t len = my_strftime (NULL, (size_t) -1, subfmt, tp);
|
||||
add (len, my_strftime (p, maxsize - i, subfmt, tp));
|
||||
|
||||
if (to_uppcase)
|
||||
@@ -1161,6 +1179,10 @@ my_strftime (s, maxsize, format, tp)
|
||||
#if HAVE_TM_GMTOFF
|
||||
diff = tp->tm_gmtoff;
|
||||
#else
|
||||
if (ut)
|
||||
diff = 0;
|
||||
else
|
||||
{
|
||||
struct tm gtm;
|
||||
struct tm ltm;
|
||||
time_t lt;
|
||||
@@ -1189,6 +1211,7 @@ my_strftime (s, maxsize, format, tp)
|
||||
break;
|
||||
|
||||
diff = tm_diff (<m, >m);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (diff < 0)
|
||||
@@ -1225,3 +1248,19 @@ my_strftime (s, maxsize, format, tp)
|
||||
*p = '\0';
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
#ifdef emacs
|
||||
/* For Emacs we have a separate interface which corresponds to the normal
|
||||
strftime function and does not have the extra information whether the
|
||||
TP arguments comes from a `gmtime' call or not. */
|
||||
size_t
|
||||
emacs_strftime (s, maxsize, format, tp)
|
||||
char *s;
|
||||
size_t maxsize;
|
||||
const char *format;
|
||||
const struct tm *tp;
|
||||
{
|
||||
return my_strftime (s, maxsize, format, tp, 0);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user