1
1

justify: remove "--" from the quoting regex, to avoid false paragraphs

The use of a double dash (for an option name or as sentence separator)
is too common to allow it to be seen always as a comment introducer.
Users of Lua and Postgres will have to redefine 'quotestr' themselves
if they want to be able to rewrap block comments with ^J.

The other characters that were added in commit c5a72103 (!, %, and ;)
are less problematic because they tend to be glued to the end of words,
so they are unlikely to appear at the start of a line.

This fixes https://savannah.gnu.org/bugs/?56462,
and fixes https://savannah.gnu.org/bugs/?56461.

Bug existed since version 4.0, commit c5a72103.
Этот коммит содержится в:
Benno Schulenberg 2019-06-08 16:31:37 +02:00
родитель f03c87c300
Коммит 33fea90bcd

Просмотреть файл

@ -2444,7 +2444,7 @@ int main(int argc, char **argv)
if (brackets == NULL)
brackets = mallocstrcpy(NULL, "\"')>]}");
if (quotestr == NULL)
quotestr = mallocstrcpy(NULL, "^([ \t]*([!#%:;>|}]|/{2}|--))+");
quotestr = mallocstrcpy(NULL, "^([ \t]*([!#%:;>|}]|/{2}))+");
/* Compile the quoting regex, and exit when it's invalid. */
quoterc = regcomp(&quotereg, quotestr, NANO_REG_EXTENDED);