Code Monkey home page Code Monkey logo

Comments (4)

d0vgan avatar d0vgan commented on August 17, 2024 1

Looks like this folder is used by the function DoCompare where temporary files to be compared are created... I would highly recommend to use e.g. $(PLUGINS_CONFIG_DIR)\HexEdit\Compare or %TEMP%\HexEdit\Compare instead.
The root issue is that a folder Notepad++\plugins\Compare is created by the plugin. This folder is just not applicable for the task of temporary files comparison.

from npp_hexedit.

d0vgan avatar d0vgan commented on August 17, 2024

The same behavior with HexEditor_0.9.5.19_x86.zip

from npp_hexedit.

chcg avatar chcg commented on August 17, 2024

@d0vgan See

::SendMessage(nppData._nppHandle, NPPM_GETPLUGINSCONFIGDIR, MAX_PATH, (LPARAM)configPath);
::PathRemoveBackslash(configPath);
/* Test if config path exist, if not create */
if (::PathFileExists(configPath) == FALSE)
{
vector<string> vPaths;
*_tcsrchr(configPath, '\\') = NULL;
do {
vPaths.push_back(configPath);
*_tcsrchr(configPath, NULL) = NULL;
} while (::PathFileExists(configPath) == FALSE);
for (size_t i = vPaths.size(); i > 0; --i)
{
_tcscpy(configPath, vPaths[i-1].c_str());
::CreateDirectory(configPath, NULL);
}
}
/* init compare file path */
_tcscpy(cmparePath, configPath);
*_tcsrchr(cmparePath, '\\') = NULL;
::PathAppend(cmparePath, COMPARE_PATH);

Seems that is expected behaviour. Since 7.6.x it might make sense to use the plugin subdir to create such a dir.

Additional observation:
The conf dir from NPPM_GETPLUGINSCONFIGDIR is not called first to retrieve the needed buffer size, but called just with MAX_PATH (see https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file, so maybe 260), so if the path exceed that size NULL is provided from N++. This might be the root cause of remaining #1 issues.

from npp_hexedit.

d0vgan avatar d0vgan commented on August 17, 2024

Ah, I forgot I can build the plugin myself :)
IMHO, this line in "Hex.cpp" just should not be there:
*_tcsrchr(cmparePath, '\\') = NULL;
What it does is it jumps one level up from the "Config" folder.
Why???
I have no answer for this.
I've started to experiment with the code (such as removing the mentioned line). In such case, the "Compare" folder is created under the "Config" folder, but after a few additional actions (when I checked how the comparison works) the plugin just crashed :( That killed my enthusiasm of further experiments.

from npp_hexedit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.