Allow escaped delimiters in transform expressions.

Patch provided by Charles McGarvey and Flavio Poletti.

* src/transform.c (parse_transform_expr): Allow escaped delimiters
in transform expressions.
* tests/xform02.at: New test case.
* tests/Makefile.am: Add xform02.at
* tests/testsuite.at: Include xform02.at
* THANKS: Update.
This commit is contained in:
Sergey Poznyakoff
2016-01-20 11:16:02 +02:00
parent 445293654d
commit 63f2e969dd
5 changed files with 50 additions and 8 deletions

View File

@@ -378,13 +378,15 @@ parse_transform_expr (const char *expr)
break;
default:
/* Try to be nice */
{
char buf[2];
buf[0] = '\\';
buf[1] = *cur;
add_literal_segment (tf, buf, buf + 2);
}
if (*cur == delim)
add_char_segment (tf, delim);
else
{
char buf[2];
buf[0] = '\\';
buf[1] = *cur;
add_literal_segment (tf, buf, buf + 2);
}
cur++;
break;
}