[gs-cvs] rev 6906 - trunk/gs/src

leonardo at ghostscript.com leonardo at ghostscript.com
Wed Jul 12 04:26:28 PDT 2006


Author: leonardo
Date: 2006-07-12 04:26:28 -0700 (Wed, 12 Jul 2006)
New Revision: 6906

Modified:
   trunk/gs/src/gdevpdf.c
Log:
Fix (pdfwrite) : More PDF/A-1b complience, continued 4.

DETAILS :

Bug 688783 "commit 6892 mis-uses the TZ environmental".

An improved code with using CRTL functions to compute the tize zone.
Thanks to SaGS for suggestion.

DIFFERENCES :

None.


Modified: trunk/gs/src/gdevpdf.c
===================================================================
--- trunk/gs/src/gdevpdf.c	2006-07-11 21:32:55 UTC (rev 6905)
+++ trunk/gs/src/gdevpdf.c	2006-07-12 11:26:28 UTC (rev 6906)
@@ -246,7 +246,6 @@
 private void
 write_time_zone(char *buf, int offset)
 {
-
     time_t t;
     struct tm tms;
     int timeoffset, hours, minutes;
@@ -254,12 +253,19 @@
 
     t = time(NULL);
     tms = *gmtime(&t);
+#ifndef _MSC_VER
+    tms.tm_isdst = -1;
+#endif
     timeoffset = (int)difftime(mktime(&tms), t); /* tz+dst, seconds */
-    s = (timeoffset >= 0 ? '+' : '-');
-    minutes = any_abs(timeoffset) / 60;
-    hours = minutes / 60;
-    minutes -= hours * 60;
-    sprintf(buf + offset, "%c%02d:%02d", s, hours, minutes);
+    if (timeoffset == 0)
+	strcpy(buf + offset, "Z)");
+    else {
+	s = (timeoffset >= 0 ? '+' : '-');
+	minutes = any_abs(timeoffset) / 60;
+	hours = minutes / 60;
+	minutes -= hours * 60;
+	sprintf(buf + offset, "%c%02d\'%02d\')", s, hours, minutes);
+    }
 }
 
 /* Initialize the IDs allocated at startup. */



More information about the gs-cvs mailing list