summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-03-05 22:28:40 +0200
committerArnold D. Robbins <arnold@skeeve.com>2014-03-05 22:28:40 +0200
commit31206f0309881ee76cb7aba8c7537b15c34b78aa (patch)
tree66b2451312bf8b09bf6196c5dd87b0a72660cd6c
parentfe9bbbd473aad5e3ca992bb7b1634c69d658265a (diff)
downloadgawk-31206f0309881ee76cb7aba8c7537b15c34b78aa.tar.gz
Minor fix for mktime.
-rw-r--r--ChangeLog5
-rw-r--r--builtin.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 862e2e8c..887d026c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,11 @@
* debug.c (do_commands): Initialize num to silence warnings.
Thanks to Michal Jaegermann.
+ Unrelated:
+
+ * builtin.c (do_mktime): Change lint warning for minutes to
+ check against 59, not 60. Thanks to Hermann Peifer for the report.
+
2014-03-03 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with grep. Yet again.
diff --git a/builtin.c b/builtin.c
index 72aea3b0..ffc303ab 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1999,10 +1999,10 @@ do_mktime(int nargs)
& hour, & minute, & second,
& dst);
- if (do_lint /* Ready? Set! Go: */
- && ( (second < 0 || second > 60)
- || (minute < 0 || minute > 60)
- || (hour < 0 || hour > 23)
+ if ( do_lint /* Ready? Set! Go: */
+ && ( (second < 0 || second > 60)
+ || (minute < 0 || minute > 59)
+ || (hour < 0 || hour > 23) /* FIXME ISO 8601 allows 24 ? */
|| (day < 1 || day > 31)
|| (month < 1 || month > 12) ))
lintwarn(_("mktime: at least one of the values is out of the default range"));