Use path to executable when trying to load library#5082
Conversation
|
danmar
left a comment
There was a problem hiding this comment.
I think this looks good.
Except on Cygwin. I wonder how this worked before. |
|
So apparently we need a relative path in Cygwin for some reason. This is the command line from |
This reverts commit 5a68d71.
Cygwin emulates Linux as far as possible so If you want to support both, the following may work because Cygwin programs also understand Windows pathnames: +#if defined(_WIN32) || defined(__CYGWIN__)
+ success = (GetModuleFileNameA(nullptr, buf, sizeof(buf)) < sizeof(buf));
+#elif defined(__APPLE__) |
|
Thanks for your quick response. It seems that the Cygwin path (from |
|
It usually does not make any sense to pass a Cygwin path containing Someone using the Cygwin version of cppcheck for some reason also wants to use the Cygwin version of python :-) |
|
That did it, thanks again 👍 |
|
Can this be merged? |
|
I ran into this as well and when I tried to fix it I came up with the same horrible code we have now because it required the path to be available before we have access to I didn't even realize that our code already contained the logic partially. If I had I would have just put my code up for review and it would have been fixed earlier. Sorry about that and thanks for fixing this. |
|
It turns out I didn't delete the code but just didn't finish it: firewave@a997b4e. I haven't checked if there is still something to salvage in there yet. |
No description provided.