From a3c015993ab98cac196a819df668b6d0b0ba0b06 Mon Sep 17 00:00:00 2001 From: dehilsterlexis Date: Tue, 2 Jul 2024 16:31:27 -0400 Subject: [PATCH] NLP-ENGINE-419 fixed file dir_char for global file functions Signed-off-by: dehilsterlexis --- .vscode/launch.json | 25 ++++++++++++++++++++++--- lite/fn.cpp | 4 ++-- lite/io.cpp | 20 ++++++++------------ nlp/main.cpp | 2 +- 4 files changed, 33 insertions(+), 18 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index c53b93ee..c599c6e4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,9 +1,28 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + \ Use IntelliSense to learn about possible attributes. + \ Hover to view descriptions of existing attributes. + \ For more information, visit: https:\go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "name": "Corp Test (linux)", + "type": "cppdbg", + "request": "launch", + "program": "/home/dehilster/nlp-engine/bin/nlp", + "args": ["-ANA","/home/dehilster/analyzers/Test","-WORK","/home/dehilster/nlp-engine/","/home/dehilster/analyzers/Test/input/após.txt","-DEV"], + "stopAtEntry": false, + "cwd": "/home/dehilster/nlp-engine/", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, { "name": "Parse EN-US (win)", "type": "cppvsdbg", diff --git a/lite/fn.cpp b/lite/fn.cpp index c794e198..be3bf5ae 100644 --- a/lite/fn.cpp +++ b/lite/fn.cpp @@ -8826,11 +8826,11 @@ for (;;) case ':': // Got drive. buf[0] = '\0'; bptr = buf; - if (*++ptr != '\\') + if (*++ptr != DIR_CH) goto err; ++ptr; // Sluff the directory char. break; - case '\\': // Got directory. + case DIR_CH: // Got directory. // Intern string, build arg. *bptr = '\0'; // Terminate string. parse->internStr(buf, /*UP*/ str); diff --git a/lite/io.cpp b/lite/io.cpp index b6c7ad35..d4fe7c5a 100644 --- a/lite/io.cpp +++ b/lite/io.cpp @@ -188,11 +188,7 @@ while (--ptr != file) // Go backward now. } return true; // 12/03/98 AM. } -#ifndef LINUX - if (*ptr == '\\') // Found backslash. Stop looking for period. -#else - if (*ptr == DIR_CH) // Found slash. -#endif + if (*ptr == DIR_CH) // Found backslash. Stop looking for period. break; } @@ -641,7 +637,7 @@ ptr--; // Back to end of string. // Go backward, finding backslash if any. while (--ptr != file) { - if (*ptr == '\\') // Found backslash. + if (*ptr == DIR_CH) // Found backslash. break; } fname = ++ptr; // Points to filename, if any, now. @@ -677,7 +673,7 @@ ptr--; // Back to end of string. // Go backward, finding backslash if any. while (--ptr != file) { - if (*ptr == '\\') // Found backslash. + if (*ptr == DIR_CH) // Found backslash. { *ptr = '\0'; // Terminate path. fpath = file; // Return pointer to path. @@ -717,7 +713,7 @@ bool file_parent( // Go backward, finding backslash if any. int slashCount = 0; while (--ptr != file) { - if (*ptr == '\\') { + if (*ptr == DIR_CH) { slashCount++; if (slashCount == 1) { *ptr = '\0'; @@ -763,11 +759,11 @@ while (--ptr != file) { if (*ptr == '.') // Found period. break; - if (*ptr == '\\') // Found backslash first. + if (*ptr == DIR_CH) // Found backslash first. break; } -if (*ptr == '\\') // Found backslash first. +if (*ptr == DIR_CH) // Found backslash first. { fhead = ++ptr; // No extension in file string. return true; @@ -796,7 +792,7 @@ if (*ptr != '.' || ptr == file) // Look for backslash of beginning of file. while (--ptr != file) { - if (*ptr == '\\') // Found backslash. + if (*ptr == DIR_CH) // Found backslash. { fhead = ++ptr; return true; // Got file head. @@ -842,7 +838,7 @@ while (--ptr != file) ftail = ++ptr; return true; } - if (*ptr == '\\') // Found backslash first. + if (*ptr == DIR_CH) // Found backslash first. { // No file tail (ie, extension). return false; diff --git a/nlp/main.cpp b/nlp/main.cpp index b85612b6..a7bbce8f 100644 --- a/nlp/main.cpp +++ b/nlp/main.cpp @@ -15,7 +15,7 @@ All rights reserved. #include "lite/nlp_engine.h" #include "version.h" -#define NLP_ENGINE_VERSION "2.11.4" +#define NLP_ENGINE_VERSION "2.11.7" bool cmdReadArgs(int,_TCHAR*argv[],_TCHAR*&,_TCHAR*&,_TCHAR*&,_TCHAR*&,bool&,bool&,bool&); void cmdHelpargs(_TCHAR*);