*
* Copyright (c) 1998--2022 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdlib.h>
if (!field_defined(str))
return 1; // and keep the defaults
+ // Historically, filters allowed writing hexadecimal numbers with leading "0x".
+ // This was never intentional nor documented, but some people relied on it.
+ if (!maskp && str[0] == '0' && (str[1] == 'x' || str[1] == 'X'))
+ str += 2;
+
while (*str)
{
int c = *str++;