From ea2cf705d50024b09e00f8f5bf9c666429bccfa5 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Wed, 10 Mar 2010 13:29:11 +0800 Subject: [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 --- ChangeLog | 4 ++++ src/arith_yacc.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e6e82f1..0802048 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-03-10 Jilles Tjoelker + + * Fix logical or result value. + 2010-03-09 Herbert Xu * Fix binary operator parsing. diff --git a/src/arith_yacc.c b/src/arith_yacc.c index 74b95f8..6c5a720 100644 --- a/src/arith_yacc.c +++ b/src/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) -- cgit 1.4.1 bin/1sh?id=6f3421d7ec1abc2b88ef886ff6bc3db042f4ffe9&follow=1'>diff
Commit message (Expand)Author
2020-01-08Set Bl -column tables to 100% widthJune McEnroe
2020-01-08Don't add dt margins to Bl-compact listsJune McEnroe
2020-01-08Use mandoc -T html for about-filterJune McEnroe
2020-01-05Add The Book of FloraJune McEnroe
2020-01-04Replace gr alias with git resetJune McEnroe
2020-01-03Remove shotty -c flag from upJune McEnroe
2020-01-03Add Darling Don't CryJune McEnroe
2020-01-01Update license header templates for the new yearJune McEnroe
2019-12-26Add \S to sort inside bracesJune McEnroe
2019-12-23Reformat music.txtJune McEnroe
2019-12-23Rename music.md to music.txtJune McEnroe
2019-12-23Add DO YOU DOUBT ME TRAITORJune McEnroe
2019-12-22Add license header to cgit CSSJune McEnroe
2019-12-22Add The Book of EttaJune McEnroe
2019-12-21Revert "Add first working version of imbox"June McEnroe
2019-12-21Add first working version of imboxJune McEnroe
2019-12-20Respect mailmap in gl pretty formatJune McEnroe
2019-12-20Set LANG in cgit filtersJune McEnroe
2019-12-20Source .editrc before applying -v or -eJune McEnroe
2019-12-20Disable signing commitsJune McEnroe
2019-12-19Ignore about-filterJune McEnroe
2019-12-19Fix matching make tags with no sourcesJune McEnroe
2019-12-19Avoid matching := assignments as tagsJune McEnroe
2019-12-18Hide line numbers when rendering mdocJune McEnroe
2019-12-18Customize cgit CSSJune McEnroe
2019-12-18Use :target rather than :focus pseudo-classJune McEnroe
2019-12-18Copy cgit auxiliary binaries properlyJune McEnroe
2019-12-18Add git.causal.agency cgit configJune McEnroe
2019-12-18Bail from hi if input is binaryJune McEnroe
2019-12-16Post "cgit setup"June McEnroe