- May
- 12,645
- 155
My plugins are on a volume mounted on various "plugins" directories. So both TCC v11 and v12 use the same 4UTILS.DLL. I use the PERL syntax. I see this with v11:
And I see this with v12:
That is, with v11, "3" followed by EOL is found, with v12, it's not.
Apparently, the newest ONIG.DLL is faulty since the problem follows the DLL (v12 gets it right with the older DLL, v11 gets it wrong with the newer DLL).
More testing shows that the newer (bad) DLL recognizes "\n" as EOL, but not "\r" or }\r\n":
That would seem a horrible bug in the Onig code, one that wouldn't last long. Could it be in the building or initializing of the DLL?
Note that 4UTILS.DLL sets the default regex syntax (as below, and correctly, verified) and calls onig_search() with ONIG_ENCODING_UTF16_LE and ONIG_SYNTAX_DEFAULT.
Code:
v:\> ver & echo 123 | grepp 3$
TCC 11.00.52 Windows XP [Version 5.1.2600]
123
v:\>
Code:
v:\> ver & echo 123 | grepp 3$
TCC 12.00.42 Windows XP [Version 5.1.2600]
v:\>
Apparently, the newest ONIG.DLL is faulty since the problem follows the DLL (v12 gets it right with the older DLL, v11 gets it wrong with the newer DLL).
More testing shows that the newer (bad) DLL recognizes "\n" as EOL, but not "\r" or }\r\n":
Code:
v:\> echos 123^n | grepp 3$
123
v:\> echos 123^r | grepp 3$
v:\> echos 123^r^n | grepp 3$
v:\>
Note that 4UTILS.DLL sets the default regex syntax (as below, and correctly, verified) and calls onig_search() with ONIG_ENCODING_UTF16_LE and ONIG_SYNTAX_DEFAULT.
Code:
VOID GetRegexSyntax ( VOID )
{
WCHAR szResponse[16];
OnigSyntaxType *psyntax = ONIG_SYNTAX_PERL;
if ( !QueryOptionValue( L"RegularExpressions", szResponse ) )
switch ( CharUpper(szResponse)[1] )
{
case L'E' : psyntax = ONIG_SYNTAX_PERL; break;
case L'U' : psyntax = ONIG_SYNTAX_RUBY; break;
case L'A' : psyntax = ONIG_SYNTAX_JAVA; break;
case L'R' : psyntax = ONIG_SYNTAX_GREP; break;
case L'O' : psyntax = ONIG_SYNTAX_POSIX_EXTENDED; break;
case L'N' : psyntax = ONIG_SYNTAX_GNU_REGEX;
}
onig_set_default_syntax(psyntax);
}