mirror of
https://github.com/ascii-boxes/boxes.git
synced 2025-06-26 12:42:44 +02:00
Simplify pattern in adjust_eols() in 'parsecode' module
This commit is contained in:
parent
13c5ef8e43
commit
0dcfdf2963
@ -874,7 +874,7 @@ int action_add_alias(pass_to_bison *bison_args, char *alias_name)
|
|||||||
static bxstr_t *adjust_eols(uint32_t *sample)
|
static bxstr_t *adjust_eols(uint32_t *sample)
|
||||||
{
|
{
|
||||||
if (eol_pattern == NULL) {
|
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);
|
uint32_t *replaced = regex_replace(eol_pattern, opt.eol, sample, u32_strlen(sample), 1);
|
||||||
bxstr_t *result = bxs_from_unicode(replaced);
|
bxstr_t *result = bxs_from_unicode(replaced);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user