From 0dcfdf296317c43b036651cc37250421d8d14579 Mon Sep 17 00:00:00 2001 From: Thomas Jensen Date: Mon, 13 May 2024 21:55:50 +0200 Subject: [PATCH] Simplify pattern in adjust_eols() in 'parsecode' module --- src/parsecode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parsecode.c b/src/parsecode.c index bb57774..ee20ded 100644 --- a/src/parsecode.c +++ b/src/parsecode.c @@ -874,7 +874,7 @@ int action_add_alias(pass_to_bison *bison_args, char *alias_name) static bxstr_t *adjust_eols(uint32_t *sample) { if (eol_pattern == NULL) { - eol_pattern = compile_pattern("(?(?=\r)(\r\n?)|(\n))"); + eol_pattern = compile_pattern("(?:(\r\n?)|(\n))"); } uint32_t *replaced = regex_replace(eol_pattern, opt.eol, sample, u32_strlen(sample), 1); bxstr_t *result = bxs_from_unicode(replaced);