summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1993-12-23 00:08:23 +0000
committerJim Meyering <jim@meyering.net>1993-12-23 00:08:23 +0000
commitd7daf7444e175ba8ceb752b6ee09a35ff72e8920 (patch)
tree95266d98b87626a408ad04da246c593bd7e54910 /src
parent797585985fffbf0f6e6ef09113051d2ebc976193 (diff)
downloadcoreutils-d7daf7444e175ba8ceb752b6ee09a35ff72e8920.tar.xz
.
Diffstat (limited to 'src')
-rw-r--r--src/date.c2
-rw-r--r--src/expr.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/date.c b/src/date.c
index 08998b2e1..b6159f209 100644
--- a/src/date.c
+++ b/src/date.c
@@ -64,7 +64,6 @@
#endif
#ifndef STDC_HEADERS
-time_t mktime ();
size_t strftime ();
time_t time ();
#endif
@@ -269,6 +268,7 @@ FORMAT controls the output. Interpreted sequences are:\n\
%%n a newline\n\
%%p locale's AM or PM\n\
%%r time, 12-hour (hh:mm:ss [AP]M)\n\
+ %%s seconds since 00:00:00, Jan 1, 1970 (a nonstandard extension)\n\
%%t a horizontal tab\n\
%%w day of week (0..6)\n\
%%x locale's date representation (mm/dd/yy)\n\
diff --git a/src/expr.c b/src/expr.c
index e5549140f..a3d42ff4c 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -316,6 +316,9 @@ toarith (v)
case string:
i = 0;
cp = v->u.s;
+ /* Don't interpret the empty string as an integer. */
+ if (*cp == 0)
+ return 0;
neg = (*cp == '-');
if (neg)
cp++;