Thanks a lot for maintaining OWLNext!
I use C++Builder Community Edition (Clang compiler) with the most recent version of OWLNext (7.0, just downloaded with recent version of OWLMaker).
I have a slightly unusual setup — I pass command-line arguments to OWL-based programs. As such, I ran into a problem: the program does not run if there are unquoted command-line arguments. After debugging, I found that, on line 67 of "winmain.cpp", the argument to find_if is incorrect:
auto parseString = [](TIt& i, TIt end) -> tstring
{
PRECONDITION(i != end);
const auto e = find_if(i, end, [](tchar c) { return !_istspace(c); });
const auto s = tstring{i, e};
i = e;
return s;
};
Since we are looking for the end of the word, we should find the first space character! However, we are looking for the first non-space character. This leads to an infinite loop and stack overflow.
Please remove the "!" operator, so that line 67 becomes:
const auto e = find_if(i, end, [](tchar c) { return _istspace(c); });
Thank you very much!
Test: Run any OWL-based program built with Clang with any command-line arguments:
program.exe any-argument
Note: parseQuotedString is correct!
News: 2022/12/owlnext-709-and-64419-updates
Wiki: OWLNext_Stable_Releases
Hi Konstantin, thanks for reporting this issue!
It seems it is an error in the refactoring I did a while ago. See [r2844].
Related
Commit: [r2844]
Diff:
This issue was fixed on the trunk in [r6213] by applying Konstantin's suggested fix, and the fix has been merged into 6.44 [r6214] and 7.0 [r6215].
Related
Commit: [r6213]
Commit: [r6214]
Commit: [r6215]