Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NLP-ENGINE-419 fixed file dir_char for global file functions #495

Merged
merged 2 commits into from
Jul 2, 2024
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
25 changes: 22 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions lite/fn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
20 changes: 8 additions & 12 deletions lite/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion nlp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ All rights reserved.
#include "lite/nlp_engine.h"
#include "version.h"

#define NLP_ENGINE_VERSION "2.11.6"
#define NLP_ENGINE_VERSION "2.11.7"

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