-
Notifications
You must be signed in to change notification settings - Fork 454
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
perf: find path efficiently for clangd argus, close #765. #780
Conversation
Signed-off-by: ayamir <lgt986452565@gmail.com>
I'm not sure if this will work or not, especially we will have sunchangtan and Groveer can test the patch first. |
Test passed on my windows PC, but need more tests to confirm. |
I test passed. it works good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also works on my Windows 10 VM :) In fact, checking fs.c
- $PATH
is correctly resolved:
static bool is_executable_in_path(const char *name, char **abspath)
FUNC_ATTR_NONNULL_ARG(1)
{
const char *path_env = os_getenv("PATH");
// ...... //
size_t buf_len = strlen(name) + strlen(path) + 2;
char *buf = xmalloc(buf_len);
// ...... //
while (true) {
char *e = xstrchrnul(p, ENV_SEPCHAR);
// Combine the $PATH segment with `name`.
xstrlcpy(buf, p, (size_t)(e - p) + 1);
append_path(buf, name, buf_len);
#ifdef MSWIN
if (is_executable_ext(buf, abspath)) {
#else
// ...... //
#endif
rv = true;
goto end;
}
// ...... //
}
I test passed. it works good. |
…ir#780) Signed-off-by: ayamir <lgt986452565@gmail.com>
…ir#780) Signed-off-by: ayamir <lgt986452565@gmail.com>
…ir#780) Signed-off-by: ayamir <lgt986452565@gmail.com>
@sunchangtan @Groveer