Skip to content

logs/ is made on Linux and macOS; a CRLF .kbb or .dict loads there (4.2.52) - #815

Merged
ddehilster merged 1 commit into
VisualText:masterfrom
ddehilster:fix/linux-logs-crlf-kb
Oct 29, 2026
Merged

ddehilster merged 1 commit into
VisualText:masterfrom
ddehilster:fix/linux-logs-crlf-kb

Conversation

@ddehilster

Copy link
Copy Markdown
Member

logs/ on Linux and macOS

dir_exists() and make_dir() in lite/mach.cpp are no-ops off Windows, so NLP::init never made <analyzer>/logs there. make_ana.log, cgerr.log and file.log all failed to open without a word, and an analyzer that did not build left no diagnostics at all on Linux.

init now makes logs/ with std::filesystem, as the compile branch already does for run/ (NLP-ENGINE-527). dir_exists()/make_dir() are left alone, because the macOS parse-en-us test depends on them.

CRLF .kbb / .dict

readKBB, readDict and findDictConcept read lines with a bare getline(). A .kbb or .dict checked out on Windows has CRLF line ends. Read on Linux or macOS, every line kept its \r: the concepts loaded as "verbs\r", and findconcept("verbs") came back null with no error. They now drop a trailing \r, as readFullLine() already did for the lazy *full files.

Windows reads these files in text mode and was not affected. .kb command files already handled \r.

Testing

Built the NLPPlus wheel against this change on Windows and on Linux (WSL, Ubuntu 24.04). The py-package test suite passed: 28/28 on Windows; on Linux 26 passed and 2 Windows-only tests were skipped. That includes new tests for logs/make_ana.log and a CRLF .kbb. Both of those fail on Linux with 4.2.51.

The companion py-package PR raises AnalyzerError with the make_ana.log diagnostics, which this change makes available on Linux.

🤖 Generated with Claude Code

….2.52)

dir_exists() and make_dir() in lite/mach.cpp are no-ops off Windows, so
NLP::init never made <analyzer>/logs there. make_ana.log, cgerr.log and
file.log all failed to open without a word, and an analyzer that did not
build left no diagnostics at all on the platform that serves clients.
init now makes logs/ with std::filesystem, as the compile branch already
does for run/ (NLP-ENGINE-527). dir_exists()/make_dir() are left alone.

readKBB, readDict and findDictConcept read lines with a bare getline().
A .kbb or .dict checked out on Windows has CRLF line ends, and read on
Linux or macOS every line kept its '\r': the concepts loaded as
"verbs\r" and findconcept("verbs") came back null, with no error. They
now drop a trailing '\r', as readFullLine() already did for the lazy
*full files. (Windows reads these in text mode and was not affected;
.kb command files already handled '\r'.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ddehilster
ddehilster merged commit c5c421e into VisualText:master Oct 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant