Fixed broken arithmetic expression parser.
Reminded by: bde In memory of: alane
This commit is contained in:
parent
a5d841d4ce
commit
c94d70434f
@ -41,6 +41,9 @@ all:
|
|||||||
@echo "Running test funny_targets"
|
@echo "Running test funny_targets"
|
||||||
@${MAKE} funny_targets || ${MAKE} failure
|
@${MAKE} funny_targets || ${MAKE} failure
|
||||||
@echo "PASS: Test funny_targets detected no regression."
|
@echo "PASS: Test funny_targets detected no regression."
|
||||||
|
@echo "Running test arith_expr"
|
||||||
|
@${MAKE} arith_expr || ${MAKE} failure
|
||||||
|
@echo "PASS: Test arith_expr detected no regression."
|
||||||
|
|
||||||
.if make(double)
|
.if make(double)
|
||||||
# Doubly-defined targets. make(1) will warn, but use the "right" one. If it
|
# Doubly-defined targets. make(1) will warn, but use the "right" one. If it
|
||||||
@ -90,6 +93,15 @@ colons::target:
|
|||||||
exclamation!target:
|
exclamation!target:
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
.if make(arith_expr)
|
||||||
|
arith_expr:
|
||||||
|
# See if arithmetic expression parsing is broken.
|
||||||
|
# The different spacing below is intentional.
|
||||||
|
VALUE= 0
|
||||||
|
.if (${VALUE} < 0)||(${VALUE}>0)
|
||||||
|
.endif
|
||||||
|
.endif
|
||||||
|
|
||||||
failure:
|
failure:
|
||||||
@echo "FAIL: Test failed: regression detected. See above."
|
@echo "FAIL: Test failed: regression detected. See above."
|
||||||
@false
|
@false
|
||||||
|
@ -41,6 +41,9 @@ all:
|
|||||||
@echo "Running test funny_targets"
|
@echo "Running test funny_targets"
|
||||||
@${MAKE} funny_targets || ${MAKE} failure
|
@${MAKE} funny_targets || ${MAKE} failure
|
||||||
@echo "PASS: Test funny_targets detected no regression."
|
@echo "PASS: Test funny_targets detected no regression."
|
||||||
|
@echo "Running test arith_expr"
|
||||||
|
@${MAKE} arith_expr || ${MAKE} failure
|
||||||
|
@echo "PASS: Test arith_expr detected no regression."
|
||||||
|
|
||||||
.if make(double)
|
.if make(double)
|
||||||
# Doubly-defined targets. make(1) will warn, but use the "right" one. If it
|
# Doubly-defined targets. make(1) will warn, but use the "right" one. If it
|
||||||
@ -90,6 +93,15 @@ colons::target:
|
|||||||
exclamation!target:
|
exclamation!target:
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
.if make(arith_expr)
|
||||||
|
arith_expr:
|
||||||
|
# See if arithmetic expression parsing is broken.
|
||||||
|
# The different spacing below is intentional.
|
||||||
|
VALUE= 0
|
||||||
|
.if (${VALUE} < 0)||(${VALUE}>0)
|
||||||
|
.endif
|
||||||
|
.endif
|
||||||
|
|
||||||
failure:
|
failure:
|
||||||
@echo "FAIL: Test failed: regression detected. See above."
|
@echo "FAIL: Test failed: regression detected. See above."
|
||||||
@false
|
@false
|
||||||
|
@ -688,16 +688,13 @@ do_string_compare:
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
char *c = CondCvtArg(rhs, &right);
|
char *c = CondCvtArg(rhs, &right);
|
||||||
if (*c != '\0' && !isspace((unsigned char) *c))
|
if (c == rhs)
|
||||||
goto do_string_compare;
|
goto do_string_compare;
|
||||||
if (rhs == condExpr) {
|
if (rhs == condExpr) {
|
||||||
/*
|
/*
|
||||||
* Skip over the right-hand side
|
* Skip over the right-hand side
|
||||||
*/
|
*/
|
||||||
while(!isspace((unsigned char) *condExpr) &&
|
condExpr = c;
|
||||||
(*condExpr != '\0')) {
|
|
||||||
condExpr++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user