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
1 changed files with 8 additions and 2 deletions
|
@ -593,13 +593,19 @@ dfilter_compile_full(const gchar *text, dfilter_t **dfp,
|
||||||
dfilter_t *dfcode;
|
dfilter_t *dfcode;
|
||||||
df_error_t *error = NULL;
|
df_error_t *error = NULL;
|
||||||
|
|
||||||
ws_assert(text);
|
|
||||||
ws_assert(*text);
|
|
||||||
ws_assert(dfp);
|
ws_assert(dfp);
|
||||||
*dfp = NULL;
|
*dfp = NULL;
|
||||||
if (caller == NULL)
|
if (caller == NULL)
|
||||||
caller = "(unknown)";
|
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);
|
ws_debug("Called from %s() with filter: %s", caller, text);
|
||||||
|
|
||||||
if (flags & DF_EXPAND_MACROS) {
|
if (flags & DF_EXPAND_MACROS) {
|
||||||
|
|
Loading…
Reference in a new issue