mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-06 13:14:21 +01:00
Chore: IndentPPDirectives: BeforeHash [ci skip]
This commit is contained in:
+15
-15
@@ -9,17 +9,17 @@ const char* ffFindExecutableInPath(const char* name, FFstrbuf* result) {
|
||||
return "$PATH not set";
|
||||
}
|
||||
|
||||
# ifdef _WIN32
|
||||
#ifdef _WIN32
|
||||
const bool appendExe = !ffStrEndsWithIgnCase(name, ".exe");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
for (char* token = path; *token; path = token + 1) {
|
||||
token = strchr(path,
|
||||
# ifdef _WIN32
|
||||
#ifdef _WIN32
|
||||
';'
|
||||
# else
|
||||
#else
|
||||
':'
|
||||
# endif
|
||||
#endif
|
||||
);
|
||||
if (!token) {
|
||||
token = path + strlen(path);
|
||||
@@ -27,25 +27,25 @@ const char* ffFindExecutableInPath(const char* name, FFstrbuf* result) {
|
||||
|
||||
ffStrbufSetNS(result, (uint32_t) (token - path), path);
|
||||
ffStrbufEnsureEndsWithC(result,
|
||||
# ifdef _WIN32
|
||||
#ifdef _WIN32
|
||||
'\\'
|
||||
# else
|
||||
#else
|
||||
'/'
|
||||
# endif
|
||||
#endif
|
||||
);
|
||||
ffStrbufAppendS(result, name);
|
||||
# ifdef _WIN32
|
||||
#ifdef _WIN32
|
||||
if (appendExe) {
|
||||
ffStrbufAppendS(result, ".exe");
|
||||
}
|
||||
if (!ffPathExists(result->chars, FF_PATHTYPE_FILE)) {
|
||||
continue;
|
||||
}
|
||||
# else
|
||||
#else
|
||||
if (access(result->chars, X_OK) != 0) {
|
||||
continue;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -53,10 +53,10 @@ const char* ffFindExecutableInPath(const char* name, FFstrbuf* result) {
|
||||
return "Executable not found";
|
||||
}
|
||||
#else
|
||||
# include <windows.h>
|
||||
# include <winioctl.h>
|
||||
# include <errno.h>
|
||||
# include <stdalign.h>
|
||||
#include <windows.h>
|
||||
#include <winioctl.h>
|
||||
#include <errno.h>
|
||||
#include <stdalign.h>
|
||||
|
||||
const char* ffFindExecutableInPath(const char* name, FFstrbuf* result) {
|
||||
char buffer[MAX_PATH + 1];
|
||||
|
||||
Reference in New Issue
Block a user