summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2010-02-25 08:36:39 -0700
committerEric Blake <eblake@redhat.com>2010-02-25 08:54:49 -0700
commit9a6c97eb2965adf868b26acf0ace0094dfe4cada (patch)
tree05352c9513557ef84b38c674f0d906b57ae1ff95 /src
parent0b5bd805bda0346dd6ed777826da39d5571115a0 (diff)
downloadcoreutils-9a6c97eb2965adf868b26acf0ace0094dfe4cada.tar.xz
expr: clarify error message
* src/expr.c (eval4, eval3): Clarify that expr expects integers, and not the broader category of numbers. * tests/misc/expr: Update test accordingly. Suggested by Dan Jacobson.
Diffstat (limited to 'src')
-rw-r--r--src/expr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/expr.c b/src/expr.c
index 048c59679..1ebb4b9d9 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -787,7 +787,7 @@ eval4 (bool evaluate)
if (evaluate)
{
if (!toarith (l) || !toarith (r))
- error (EXPR_INVALID, 0, _("non-numeric argument"));
+ error (EXPR_INVALID, 0, _("non-integer argument"));
if (fxn != multiply && mpz_sgn (r->u.i) == 0)
error (EXPR_INVALID, 0, _("division by zero"));
((fxn == multiply ? mpz_mul
@@ -824,7 +824,7 @@ eval3 (bool evaluate)
if (evaluate)
{
if (!toarith (l) || !toarith (r))
- error (EXPR_INVALID, 0, _("non-numeric argument"));
+ error (EXPR_INVALID, 0, _("non-integer argument"));
(fxn == plus ? mpz_add : mpz_sub) (l->u.i, l->u.i, r->u.i);
}
freev (r);