diff --git a/editors/awk.c b/editors/awk.c index f8e20679c..7943f2cd6 100644 --- a/editors/awk.c +++ b/editors/awk.c @@ -2914,7 +2914,7 @@ static int awk_sub(node *rn, const char *repl, int nm, var *src, var *dest /*,in return match_no; } -static NOINLINE int do_mktime(const char *ds) +static NOINLINE time_t do_mktime(const char *ds) { struct tm then; int count; diff --git a/testsuite/awk.tests b/testsuite/awk.tests index e2c042687..a1995c1c0 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests @@ -828,4 +828,11 @@ testing 'awk gensub backslash*8 + & in replacement' 'awk '$sq'{ print gensub(/b testing 'awk gensub backslash*10 + & in replacement' 'awk '$sq'{ print gensub(/b/, "_\\\\\\\\\\&_", 1) }'$sq 'a_\\\\&_c\n' '' 'abc\n' testing 'awk gensub backslash*12 + & in replacement' 'awk '$sq'{ print gensub(/b/, "_\\\\\\\\\\\\&_", 1) }'$sq 'a_\\\\\\b_c\n' '' 'abc\n' +optional TIME64 +testing "awk mktime() beyond 2038" \ + "TZ=UTC awk 'BEGIN { printf \"%.0f %.0f\\n\", mktime(\"2038 01 19 03 14 08\"), mktime(\"2040 01 01 00 00 00\") }'" \ + "2147483648 2208988800\n" \ + "" "" +SKIP= + exit $FAILCOUNT