mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
[w32ce] Do not print the faulty timezone info
Switch FAQ sources to org-mode
This commit is contained in:
parent
bfbd80feb9
commit
adfa280d6f
7 changed files with 440 additions and 234 deletions
|
@ -1,3 +1,7 @@
|
|||
2010-10-04 Werner Koch <wk@g10code.com>
|
||||
|
||||
* gettime.c (asctimestamp) [W32CE]: Do not print the timezone.
|
||||
|
||||
2010-09-30 Werner Koch <wk@g10code.com>
|
||||
|
||||
* util.h (GPG_ERR_FULLY_CANCELED): Add replacement.
|
||||
|
|
|
@ -330,41 +330,46 @@ isotimestamp (u32 stamp)
|
|||
* Note: this function returns local time
|
||||
*/
|
||||
const char *
|
||||
asctimestamp( u32 stamp )
|
||||
asctimestamp (u32 stamp)
|
||||
{
|
||||
static char buffer[50];
|
||||
static char buffer[50];
|
||||
#if defined (HAVE_STRFTIME) && defined (HAVE_NL_LANGINFO)
|
||||
static char fmt[50];
|
||||
static char fmt[50];
|
||||
#endif
|
||||
struct tm *tp;
|
||||
time_t atime = stamp;
|
||||
struct tm *tp;
|
||||
time_t atime = stamp;
|
||||
|
||||
if (atime < 0) {
|
||||
strcpy (buffer, "????" "-??" "-??");
|
||||
return buffer;
|
||||
if (atime < 0)
|
||||
{
|
||||
strcpy (buffer, "????" "-??" "-??");
|
||||
return buffer;
|
||||
}
|
||||
|
||||
tp = localtime( &atime );
|
||||
tp = localtime( &atime );
|
||||
#ifdef HAVE_STRFTIME
|
||||
#if defined(HAVE_NL_LANGINFO)
|
||||
mem2str( fmt, nl_langinfo(D_T_FMT), DIM(fmt)-3 );
|
||||
if( strstr( fmt, "%Z" ) == NULL )
|
||||
strcat( fmt, " %Z");
|
||||
/* NOTE: gcc -Wformat-noliteral will complain here. I have
|
||||
found no way to suppress this warning .*/
|
||||
strftime (buffer, DIM(buffer)-1, fmt, tp);
|
||||
# if defined(HAVE_NL_LANGINFO)
|
||||
mem2str( fmt, nl_langinfo(D_T_FMT), DIM(fmt)-3 );
|
||||
if (!strstr( fmt, "%Z" ))
|
||||
strcat( fmt, " %Z");
|
||||
/* NOTE: gcc -Wformat-noliteral will complain here. I have found no
|
||||
way to suppress this warning. */
|
||||
strftime (buffer, DIM(buffer)-1, fmt, tp);
|
||||
# elif defined(HAVE_W32CE_SYSTEM)
|
||||
/* tzset is not available but %Z nevertheless prints a default
|
||||
nonsense timezone ("WILDABBR"). Thus we don't print the time
|
||||
zone at all. */
|
||||
strftime (buffer, DIM(buffer)-1, "%c", tp);
|
||||
# else
|
||||
/* FIXME: we should check whether the locale appends a " %Z" These
|
||||
* locales from glibc don't put the " %Z": fi_FI hr_HR ja_JP lt_LT
|
||||
* lv_LV POSIX ru_RU ru_SU sv_FI sv_SE zh_CN. */
|
||||
strftime (buffer, DIM(buffer)-1, "%c %Z", tp);
|
||||
# endif
|
||||
buffer[DIM(buffer)-1] = 0;
|
||||
#else
|
||||
/* FIXME: we should check whether the locale appends a " %Z"
|
||||
* These locales from glibc don't put the " %Z":
|
||||
* fi_FI hr_HR ja_JP lt_LT lv_LV POSIX ru_RU ru_SU sv_FI sv_SE zh_CN
|
||||
*/
|
||||
strftime( buffer, DIM(buffer)-1, "%c %Z", tp );
|
||||
mem2str( buffer, asctime(tp), DIM(buffer) );
|
||||
#endif
|
||||
buffer[DIM(buffer)-1] = 0;
|
||||
#else
|
||||
mem2str( buffer, asctime(tp), DIM(buffer) );
|
||||
#endif
|
||||
return buffer;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue