[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fix for PR 164 (?)
From: |
Akim Demaille |
Subject: |
Re: Fix for PR 164 (?) |
Date: |
08 May 2001 17:09:07 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) |
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1067
diff -u -r1.1067 automake.in
--- automake.in 2001/05/05 21:16:36 1.1067
+++ automake.in 2001/05/06 00:40:00
@@ -5487,13 +5487,16 @@
{
my ($cond, $when) = @_;
+ # Make a hash holding all the values from $WHEN.
+ my (%cond_vals);
+ grep ($cond_vals{$_} = 1, split (' ', $when));
+
# Check each component of $cond, which looks `COND1 COND2'.
foreach my $comp (split (' ', $cond))
{
- if (index ($when, $comp) == -1)
- {
- return 0;
- }
+ # TRUE is always true.
+ return 1 if $comp eq 'TRUE';
+ return 0 if ! defined $cond_vals{$comp};
}
I don't understand why you had TRUE here. I mean, it seems to me it's
a `next' not a return. Conditionals are conjunctions, not
disjunctions.
For instance your code, I believe, will
TRUE FOO when BAR => 1
and
FOO TRUE when BAR => 0
while both should 0.