[PATCH 2/2] storage: Add "path" option, to store based on the path the article went

Julien ÉLIE julien at trigofacile.com
Tue Feb 27 21:06:22 UTC 2024


Hi Christoph,

I've just merged your patch.  Thanks again for it!
Greatly appreciated.  It is a useful feature to have for the next vagues 
of spam from specific sites.


> +static bool
> +MatchPath(const char *p, int len, const char *pattern)
> +{
> +    char *path, *q;
> +    int i, lastwhite;
> +    enum uwildmat matched;
> +
> +    path = xmalloc(len + 1);
> +    strncpy(path, p, len);
> +    path[len] = '\0';
> +    for (q = path; *q; q++)
> +        if (*q == '!')
> +            *q = '|';
> +    matched = uwildmat_poison(path, pattern);
> +    free(path);
> +    return matched;
> +}

FWIW, I've changed the last line to:

     return (matched == UWILDMAT_MATCH);

Otherwise UWILDMAT_POISON (whose value is 2) would be considered as a 
true value.
All look good otherwise.

-- 
Julien ÉLIE

« Chuck Norris once ran cd .. in / and it worked. »


More information about the inn-workers mailing list