Escape hyphen in rest.xml regular expressions
ClosedPublic

Authored by heikobecker on Aug 23 2017, 10:35 AM.

Details

Summary

The unescaped hyphen caused a build failure with pcre2-10.30 due to a broken
regex: 'syntax-highlighting/data/syntax/rest.xml" line 27 broken regex:
"^\\s*\\.\\. [w-_\\.]+::(\\s|$)" problem: "range out of order in character
class" at offset 12'.

The pcre2pattern documentation says this:

"Perl treats a hyphen as a literal if it appears before or after a POSIX class
(see below) or before or after a character type escape such as as \d or \H.
However, unless the hyphen is the last character in the class, Perl outputs a
warning in its warning mode, as this is most likely a user error. As PCRE2 has
no facility for warning, an error is given in these cases."

Test Plan

cmake && make && make test works fine pcre2-10.30, quick look at
http://docutils.sourceforge.net/FAQ.txt in kate seems fine.

Diff Detail

Repository
R216 Syntax Highlighting
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
heikobecker created this revision.Aug 23 2017, 10:35 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptAug 23 2017, 10:35 AM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript

Removed accidentally included change.

kfunk edited edge metadata.Aug 23 2017, 1:03 PM

I think so.

FWIW: Here's another upstream report, filed by Heiko himself:
https://bugs.exim.org/show_bug.cgi?id=2158

Wasn't aware of the bug report, but yes. Will add a BUG: reference before pushing if this is accepted.

vkrause accepted this revision.Aug 23 2017, 2:01 PM
This revision is now accepted and ready to land.Aug 23 2017, 2:01 PM

Please increase the version number!

Ah, right, I forget to check for the version number every time :) Thanks Dominik!

Increased version

This revision was automatically updated to reflect the committed changes.