| === modified file 'init/event_operator.c' |
| --- init/event_operator.c 2010-11-19 14:34:51 +0000 |
| +++ init/event_operator.c 2012-08-10 20:16:45 +0000 |
| @@ -326,7 +326,7 @@ |
| * matches and no such variable. |
| */ |
| if (! (eenv && *eenv)) |
| - return FALSE; |
| + return negate; |
| |
| /* Grab the value out by looking for the equals, we don't |
| * care about the name if we're positional and we've already |
| |
| === modified file 'init/tests/test_event_operator.c' |
| --- init/tests/test_event_operator.c 2010-02-04 20:08:59 +0000 |
| +++ init/tests/test_event_operator.c 2012-08-10 20:16:17 +0000 |
| @@ -763,6 +763,20 @@ |
| TEST_FALSE (event_operator_match (oper, event, NULL)); |
| |
| |
| + /* Check that unknown variable names match when negated. */ |
| + TEST_FEATURE ("with unknown variable in operator"); |
| + event->env = env1; |
| + event->env[0] = "FRODO=foo"; |
| + event->env[1] = "BILBO=bar"; |
| + event->env[2] = NULL; |
| + |
| + oper->env = env2; |
| + oper->env[0] = "MERRY!=baz"; |
| + oper->env[1] = NULL; |
| + |
| + TEST_TRUE (event_operator_match (oper, event, NULL)); |
| + |
| + |
| /* Check that the operator environment may be globs. */ |
| TEST_FEATURE ("with globs in operator environment"); |
| event->env = env1; |
| |