Re: [PATCH v2] userdiff: remove empty subexpression from elixir regex
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Dec 13, 2019, 19:24 UTC
- Message-ID
- <0c9d891e-382f-03d1-bcbd-d652f1d58f4d@kdbg.org>
- In-Reply-To
- <20191213175535.87725-1-emaste@FreeBSD.org>
Am 13.12.19 um 18:55 schrieb Ed Maste:
> The regex failed to compile on FreeBSD. > > Fixes: a807200f67588f6e
Having a references is this form is unusual for our codebase. (Not that I mind a lot, though.) I expect that Junio will commit the fix on top of the commit that introduced the bogus regex anyway (branch ln/userdiff-elixir), and then it will be easy find.
> Signed-off-by: Ed Maste <emaste@FreeBSD.org> > --- > Add /* -- */ to make things more clear and be consistent with other > patterns.
This text would be nice to have in the commit message.
Show 20 quoted lines
>
> userdiff.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/userdiff.c b/userdiff.c
> index 324916f20f..efbe05e5a5 100644
> --- a/userdiff.c
> +++ b/userdiff.c
> @@ -34,8 +34,9 @@ PATTERNS("dts",
> "|[-+*/%&^|!~]|>>|<<|&&|\\|\\|"),
> PATTERNS("elixir",
> "^[ \t]*((def(macro|module|impl|protocol|p)?|test)[ \t].*)$",
> + /* -- */
> /* Atoms, names, and module attributes */
> - "|[@:]?[a-zA-Z0-9@_?!]+"
> + "[@:]?[a-zA-Z0-9@_?!]+"
> /* Numbers with specific base */
> "|[-+]?0[xob][0-9a-fA-F]+"
> /* Numbers */
> Good catch!
Tested-by: Johannes Sixt <j6t@kdbg.org>
Thanks!
-- Hannes