diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-05-02 21:35:57 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-05-02 21:35:57 +0000 |
commit | d3ee57eb86f8d8fe234986122d2c5faf359189f1 (patch) | |
tree | 2bfa79d13edecdb87e741b3c89bca55eabe7e8aa /Build/source/texk/dvipdfm-x/pdfdoc.c | |
parent | 71aebaacc6b4c2a172582129b138a080708a4c62 (diff) |
dvipdfm-x: patch by Alexis
git-svn-id: svn://tug.org/texlive/trunk@40836 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/pdfdoc.c')
-rw-r--r-- | Build/source/texk/dvipdfm-x/pdfdoc.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/Build/source/texk/dvipdfm-x/pdfdoc.c b/Build/source/texk/dvipdfm-x/pdfdoc.c index b724789aa9b..3bf163ab4d9 100644 --- a/Build/source/texk/dvipdfm-x/pdfdoc.c +++ b/Build/source/texk/dvipdfm-x/pdfdoc.c @@ -443,11 +443,14 @@ compute_timezone_offset() time_t gmtoff; now = get_unique_time_if_given(); - if (now == 0) + if (now == 0) { now = time(NULL); - localtime_r(&now, &local); - gmtime_r(&now, &tm); - return (mktime(&local) - mktime(&tm)); + localtime_r(&now, &local); + gmtime_r(&now, &tm); + return (mktime(&local) - mktime(&tm)); + } else { + return(0); + } } #endif /* HAVE_TIMEZONE */ @@ -464,20 +467,23 @@ asn_date (char *date_string) struct tm *bd_time; current_time = get_unique_time_if_given(); - if (current_time == 0) + if (current_time == 0) { time(¤t_time); - bd_time = localtime(¤t_time); + bd_time = localtime(¤t_time); #ifdef HAVE_TM_GMTOFF - tz_offset = bd_time->tm_gmtoff; + tz_offset = bd_time->tm_gmtoff; #else # ifdef HAVE_TIMEZONE - tz_offset = -timezone; + tz_offset = -timezone; # else - tz_offset = compute_timezone_offset(); + tz_offset = compute_timezone_offset(); # endif /* HAVE_TIMEZONE */ #endif /* HAVE_TM_GMTOFF */ - + } else { + bd_time = gmtime(¤t_time); + tz_offset = 0; + } sprintf(date_string, "D:%04d%02d%02d%02d%02d%02d%c%02d'%02d'", bd_time->tm_year + 1900, bd_time->tm_mon + 1, bd_time->tm_mday, bd_time->tm_hour, bd_time->tm_min, bd_time->tm_sec, |