aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@stack.nl>2010-03-10 13:29:11 +0800
committermaximilian attems <max@stro.at>2010-03-22 00:29:18 +0100
commitd299387f8b65ea95ddae9013d5d933250efb32cc (patch)
tree09e7c9f0bd77848e191d69476a49d48b37bf0149
parent85e0590422db9f61c48413bb162297f4e573f868 (diff)
downloadklibc-d299387f8b65ea95ddae9013d5d933250efb32cc.tar.gz
[klibc] [ARITH] Fix logical or result value
Another change I'm making to the arith code is making || return 0 or 1 only, matching C, POSIX and other shells. Apart from the compliance issue, it is also bad to expose implementation details like the exact meaning of 'noeval' to scripts such that they may come to depend on them. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r--usr/dash/arith_yacc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr/dash/arith_yacc.c b/usr/dash/arith_yacc.c
index 74b95f8062720..6c5a72009c5fa 100644
--- a/usr/dash/arith_yacc.c
+++ b/usr/dash/arith_yacc.c
@@ -253,7 +253,7 @@ static intmax_t or(int token, union yystype *val, int op, int noeval)
b = or(token, val, yylex(), noeval | !!a);
- return a | b;
+ return a || b;
}
static intmax_t cond(int token, union yystype *val, int op, int noeval)