Apple Bug Friday! 73

2008-02-08 20:44:19 -08:00

This bug is ASL_QUERY_OP_REGEX should be a modifier, not an operator. It was filed on 2008-01-18 at 23:27 PST.


Summary:

ASL_QUERY_OP_REGEX is an operator unto itself, but should actually be a modifier.

Steps to Reproduce:

  1. Create a query message using asl_new.
  2. Set a property of the message with the value set to a regular expression and the operator set to ASL_QUERY_OP_NOT_EQUAL | ASL_QUERY_OP_REGEX.
  3. Pass the message to asl_search.

Expected Results:

The response contains messages where the value of the searched-for property does not match the regular expression.

Actual Results:

The response contains messages where the value of the searched-for property matches the regular expression.

Regression:

None. It was the same way on Tiger (except that Tiger’s ASL did not presume ASL_QUERY_OP_SUBSTRING, as Leopard’s ASL correctly does).

Notes:

The most obvious use case defeated by the current nature of ASL_QUERY_OP_REGEX is that you cannot search for messages that don’t match the expression.

The manpage lists ASL_QUERY_OP_REGEX as an operator, which matches reality as of Leopard. However, the header lists it among the modifiers of other operators.

For compatibility, ASL_QUERY_OP_REGEX alone should remain a valid operator value, equivalent to ASL_QUERY_OP_EQUAL | ASL_QUERY_OP_SUBSTRING | ASL_QUERY_OP_REGEX. Also, for compatibility with Leopard (if not Tiger), ASL_QUERY_OP_SUBSTRING should be presumed whenever ASL_QUERY_OP_REGEX is present, unless either ASL_QUERY_OP_PREFIX or ASL_QUERY_OP_SUFFIX (or both) is also present, or the expression says otherwise (^, $, or both).

Leave a Reply

Do not delete the second sentence.


Warning: Undefined array key "ntt_saved_comment_text" in /home/public/blog/wp-content/plugins/negative-turing-test/negative-turing-test.php on line 143