Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cs/libconsh/cg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3888,6 +3888,10 @@ bool CG::readDict(std::string file, std::vector<std::filesystem::path> kbfiles)
allDictStream_.open(file, std::ios::in);

while (std::getline(allDictStream_, line)) {
// A CRLF file (eg a Windows checkout) read on Linux/macOS keeps
// the '\r', which would end up in the last word or value.
if (!line.empty() && line.back() == '\r')
line.pop_back();
_TCHAR *buf = line.data();
lineCount++;
// Blank out /* ... */ before the line lexer sees it. A comment-only
Expand Down Expand Up @@ -4262,6 +4266,11 @@ bool CG::readKBB(std::string file) {
bool inBlock = false; // Open "/*" carried between lines.

while (std::getline(streamer, line)) {
// A CRLF file (eg a Windows checkout) read on Linux/macOS keeps
// the '\r': the concept on every line was then named "verbs\r"
// and findconcept("verbs") came back null, with no error.
if (!line.empty() && line.back() == '\r')
line.pop_back();
_TCHAR *buf = line.data();
// Blank out /* ... */ before the line lexer sees it. // 07/31/26 DD.
// Only a line the stripper actually touched is dropped when it comes
Expand Down Expand Up @@ -5194,6 +5203,9 @@ int32_t length2 = strp.length();
bool done = false;

while (allDictStream_.getline(buf, MAXMSG) && !done) {
size_t blen = strlen(buf);
if (blen && buf[blen-1] == '\r') // CRLF file read on Linux/macOS.
buf[blen-1] = '\0';
icu::StringPiece sp(buf);
const char *line = sp.data();
int32_t length = sp.length();
Expand Down
10 changes: 8 additions & 2 deletions lite/nlp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,14 @@ _TCHAR errout[MAXMSG]; // 03/22/99 AM.
_TCHAR *logdirname = _T("logs"); // 05/19/01 AM.
_TCHAR logdir[MAXSTR]; // 05/19/01 AM.
_stprintf(logdir, _T("%s%c%s"), appdir,DIR_CH,logdirname); // 05/19/01 AM.
if (!dir_exists(logdir)) // 05/19/01 AM.
make_dir(logdir); // 05/19/01 AM.
// std::filesystem, not dir_exists()/make_dir(): both are no-ops on
// Linux/macOS (see NLP-ENGINE-527 below), so logs/ was never made there
// and make_ana.log, cgerr.log and file.log silently failed to open. A
// failed analyzer build then left no diagnostics at all off Windows.
{
std::error_code ec;
std::filesystem::create_directory(logdir, ec);
}


// SOME GLOBAL INITS. // 09/27/00 AM.
Expand Down
2 changes: 1 addition & 1 deletion nlp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ All rights reserved.

#include <vector>

#define NLP_ENGINE_VERSION "4.2.51"
#define NLP_ENGINE_VERSION "4.2.52"

bool cmdReadArgs(int, _TCHAR *argv[], _TCHAR *&, _TCHAR *&, _TCHAR *&, _TCHAR *&, bool &, bool &, bool &, bool &, bool &, bool &, int &, bool &, bool &, _TCHAR *&, double &, _TCHAR *&);
void cmdHelpargs(_TCHAR *);
Expand Down
Loading