dfilter: Remove assertion on empty filter expression
Because existing code is dependant on the behavior that a null/empty filter is a sort of valid input (presumably to avoid having to check for that condition explicitly) add back that behavior to avoid a lot of potential hidden cascading failures.
This commit is contained in:
parent
c6fb33505e
commit
dfffd13892
|
@ -593,13 +593,19 @@ dfilter_compile_full(const gchar *text, dfilter_t **dfp,
|
|||
dfilter_t *dfcode;
|
||||
df_error_t *error = NULL;
|
||||
|
||||
ws_assert(text);
|
||||
ws_assert(*text);
|
||||
ws_assert(dfp);
|
||||
*dfp = NULL;
|
||||
if (caller == NULL)
|
||||
caller = "(unknown)";
|
||||
|
||||
if (text == NULL || *text == '\0') {
|
||||
ws_info("Called from %s() with empty filter expression", caller);
|
||||
if (err_ptr) {
|
||||
*err_ptr = df_error_new_msg("Empty filter expression");
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ws_debug("Called from %s() with filter: %s", caller, text);
|
||||
|
||||
if (flags & DF_EXPAND_MACROS) {
|
||||
|
|
Loading…
Reference in New Issue