summaryrefslogtreecommitdiff
path: root/src/expr.c
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/expr.c
parent797585985fffbf0f6e6ef09113051d2ebc976193 (diff)
downloadcoreutils-d7daf7444e175ba8ceb752b6ee09a35ff72e8920.tar.xz
.
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c3
1 files changed, 3 insertions, 0 deletions
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++;