[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-654
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-654-gf156eb5 |
Date: |
Mon, 13 Apr 2015 13:22:09 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, gawk-4.1-stable has been updated
via f156eb53457a9e4e34c1b96f9e54eb130dffd8a3 (commit)
from 0325b4daf737414c3b811b05c70b897b807a436b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=f156eb53457a9e4e34c1b96f9e54eb130dffd8a3
commit f156eb53457a9e4e34c1b96f9e54eb130dffd8a3
Author: Arnold D. Robbins <address@hidden>
Date: Mon Apr 13 16:21:22 2015 +0300
Remove fatal error if strftime timestamp < 0.
diff --git a/ChangeLog b/ChangeLog
index 98a4f7c..335ab6e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,13 @@
* regexec.c (buid_trtable, match_ctx_clean): Replace malloc/free
with re_malloc/re_free.
+ Unrelated:
+
+ * builtin.c (do_strftime): Disable checking timestamp value for less
+ than zero. Allows times before the epoch to work with strftime.
+ Thanks to Glaudiston Gomes da Silva <address@hidden>
+ for raising the issue.
+
2015-04-12 Arnold D. Robbins <address@hidden>
* Makefile.am (efence): Make this link again.
diff --git a/builtin.c b/builtin.c
index dde3121..7aeccd5 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1913,8 +1913,16 @@ do_strftime(int nargs)
lintwarn(_("strftime: received non-numeric
second argument"));
(void) force_number(t2);
clock_val = get_number_si(t2);
- if (clock_val < 0)
- fatal(_("strftime: second argument less than 0
or too big for time_t"));
+ /*
+ * 4/2015: This used to be here:
+ *
+ * if (clock_val < 0)
+ * fatal(_("strftime: second argument less than 0
or too big for time_t"));
+ *
+ * It is now disabled since some systems have strftime
that works
+ * on times before the epoch. No arbritrary limits
comes into
+ * play at this point.
+ */
fclock = (time_t) clock_val;
DEREF(t2);
}
diff --git a/test/ChangeLog b/test/ChangeLog
index 10d707c..0092932 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-13 Arnold D. Robbins <address@hidden>
+
+ * Makefile.am (negtime): New test.
+ * negtime.awk, negtime.ok: New files.
+
2015-04-09 Arnold D. Robbins <address@hidden>
* fts.awk: Skip atime to avoid spurious timestamp
diff --git a/test/Makefile.am b/test/Makefile.am
index 3973c66..e2ccdc5 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -569,6 +569,8 @@ EXTRA_DIST = \
negexp.ok \
negrange.awk \
negrange.ok \
+ negtime.awk \
+ negtime.ok \
nested.awk \
nested.in \
nested.ok \
@@ -1050,7 +1052,7 @@ GAWK_EXT_TESTS = \
include include2 indirectbuiltin indirectcall indirectcall2 \
lint lintold lintwarn \
manyfiles match1 match2 match3 mbstr1 \
- nastyparm next nondec nondec2 \
+ nastyparm negtime next nondec nondec2 \
patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge
procinfs \
profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7
pty1 \
rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline
rsglstdin rsstart1 \
@@ -2055,6 +2057,12 @@ paramasfunc2::
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden --posix >_$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+negtime::
+ @echo $@
+ @TZ=GMT AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
+
# Targets generated for other tests:
include Maketests
diff --git a/test/Makefile.in b/test/Makefile.in
index c1b691e..6ed035f 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -826,6 +826,8 @@ EXTRA_DIST = \
negexp.ok \
negrange.awk \
negrange.ok \
+ negtime.awk \
+ negtime.ok \
nested.awk \
nested.in \
nested.ok \
@@ -1306,7 +1308,7 @@ GAWK_EXT_TESTS = \
include include2 indirectbuiltin indirectcall indirectcall2 \
lint lintold lintwarn \
manyfiles match1 match2 match3 mbstr1 \
- nastyparm next nondec nondec2 \
+ nastyparm negtime next nondec nondec2 \
patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge
procinfs \
profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7
pty1 \
rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline
rsglstdin rsstart1 \
@@ -2491,6 +2493,11 @@ paramasfunc2::
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden --posix >_$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
+negtime::
+ @echo $@
+ @TZ=GMT AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
diff --git a/test/negtime.awk b/test/negtime.awk
new file mode 100644
index 0000000..743c6d0
--- /dev/null
+++ b/test/negtime.awk
@@ -0,0 +1,4 @@
+BEGIN {
+then = mktime("1959 12 15 7 00 00")
+print strftime(PROCINFO["strftime"], then)
+}
diff --git a/test/negtime.ok b/test/negtime.ok
new file mode 100644
index 0000000..aa2ae69
--- /dev/null
+++ b/test/negtime.ok
@@ -0,0 +1 @@
+Tue Dec 15 07:00:00 GMT 1959
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
builtin.c | 12 ++++++++++--
test/ChangeLog | 5 +++++
test/Makefile.am | 10 +++++++++-
test/Makefile.in | 9 ++++++++-
test/negtime.awk | 4 ++++
test/negtime.ok | 1 +
7 files changed, 44 insertions(+), 4 deletions(-)
create mode 100644 test/negtime.awk
create mode 100644 test/negtime.ok
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-654-gf156eb5,
Arnold Robbins <=