summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog9
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c12
2 files changed, 19 insertions, 2 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index 8062c326881..94b1d492f27 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,12 @@
+2016-05-06 Karl Berry <karl@tug.org>
+
+ * texmfmp.c (init_start_time, get_date_and_time) [onlyTeX]:
+ ignore SOURCE_DATE_EPOCH... envvars for original TeX.
+
+2016-05-05 Akira Kakuto <kakuto@fuk.kinidai.ac.jp>
+
+ * texmfmp.c (strtoull) [_MSC_VER]: #define as _strtoi64.
+
2016-05-04 Karl Berry <karl@freefriends.org>
* texmfmp.c (init_start_time): new fn, factored out from
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index 90965456cf6..c56cd026a99 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -2213,6 +2213,7 @@ void init_start_time() {
char *endptr;
if (!start_time_set) {
start_time_set = true;
+#ifndef onlyTeX
source_date_epoch = getenv("SOURCE_DATE_EPOCH");
if (source_date_epoch) {
errno = 0;
@@ -2222,7 +2223,9 @@ FATAL1 ("invalid epoch-seconds-timezone value for environment variable $SOURCE_D
source_date_epoch);
}
start_time = epoch;
- } else {
+ } else
+#endif /* not onlyTeX */
+ {
start_time = time((time_t *) NULL);
}
}
@@ -2239,22 +2242,27 @@ get_date_and_time (integer *minutes, integer *day,
integer *month, integer *year)
{
struct tm *tmptr;
+#ifndef onlyTeX
string sde_texprim = getenv ("SOURCE_DATE_EPOCH_TEX_PRIMITIVES");
if (sde_texprim && STREQ (sde_texprim, "1")) {
init_start_time ();
tmptr = gmtime (&start_time);
- } else {
+ } else
+#endif /* not onlyTeX */
+ {
/* whether the envvar was not set (usual case) or invalid,
use current time. */
time_t myclock = time ((time_t *) 0);
tmptr = localtime (&myclock);
+#ifndef onlyTeX
/* warn if they gave an invalid value, empty (null string) ok. */
if (sde_texprim && strlen (sde_texprim) > 0
&& !STREQ (sde_texprim, "0")) {
WARNING1 ("invalid value (expected 0 or 1) for environment variable $SOURCE_DATE_EPOCH_TEX_PRIMITIVES: %s",
sde_texprim);
}
+#endif /* not onlyTeX */
}
*minutes = tmptr->tm_hour * 60 + tmptr->tm_min;