|
|||||||||||
|
user/3359: m4 treats bitwise operations in eval as logical operations
From: <flag(at)pobox.se>
Date: Fri Jul 18 2003 - 09:57:07 EDT
System : OpenBSD 3.3 Architecture: OpenBSD.i386 Machine : i386 Index: expr.c RCS file: /cvs/src/usr.bin/m4/expr.c,v retrieving revision 1.15 diff -u -r1.15 expr.c --- expr.c 3 Jun 2003 02:56:10 -0000 1.15 +++ expr.c 18 Jul 2003 13:55:57 -0000@@ -187,10 +187,14 @@
vl = land();
while ((c = skipws()) == '|') {
- if (getch() != '|')
- ungetch();
+ if (getch() != '|') {
+ ungetch();
+ vr = land();
+ vl = vl | vr;
+ } else {
vr = land();
vl = vl || vr;
+ }
}
ungetch();
@@ -207,12 +211,15 @@
vl = not();
while ((c = skipws()) == '&') {
- if (getch() != '&')
- ungetch();
+ if (getch() != '&') {
+ ungetch();
+ vr = not();
+ vl = vl & vr;
+ } else {
vr = not();
vl = vl && vr;
+ }
}
-
ungetch();
return vl;
} >Release-Note:
This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:30:00 EDT |
||||||||||
|
|||||||||||