Re: [PATCH v2 06/13] dir.c: always copy input to add_pattern()
Am 04.06.24 um 12:13 schrieb Jeff King:
> b. Now that we don't need the original string to hang around, we can
> get rid of the "filebuf" mechanism entirely
Right. This patch does remove its use from dir.c, but leaves it in dir.h:
Show 21 quoted lines
> diff --git a/dir.h b/dir.h
> index b9e8e96128..c8ff308fae 100644
> --- a/dir.h
> +++ b/dir.h
> @@ -62,7 +62,6 @@ struct path_pattern {
> */
> struct pattern_list *pl;
>
> - const char *pattern;
> int patternlen;
> int nowildcardlen;
> const char *base;
> @@ -74,6 +73,8 @@ struct path_pattern {
> * and from -1 decrementing for patterns from CLI args.
> */
> int srcpos;
> +
> + char pattern[FLEX_ARRAY];
> };
>
> /* used for hashmaps for cone patterns */It can be dropped from struct pattern_list now, for completeness' sake.
René