mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
Global: replaces NULL to nullptr
This commit is contained in:
@@ -50,14 +50,14 @@ const char* ffDetectEditor(FFEditorResult* result) {
|
||||
} else {
|
||||
const char* error = ffFindExecutableInPath(result->name.chars, &result->path);
|
||||
if (error) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
char buf[PATH_MAX + 1];
|
||||
if (!realpath(result->path.chars, buf)) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// WIN32: Should we handle scoop shim exe here?
|
||||
@@ -77,11 +77,11 @@ const char* ffDetectEditor(FFEditorResult* result) {
|
||||
#endif
|
||||
);
|
||||
if (index == result->path.length) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
ffStrbufSetS(&result->exe, &result->path.chars[index + 1]);
|
||||
if (!result->exe.length) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -92,7 +92,7 @@ const char* ffDetectEditor(FFEditorResult* result) {
|
||||
}
|
||||
|
||||
if (!instance.config.general.detectVersion) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (ffStrbufEqualS(&result->exe, "nvim")) {
|
||||
@@ -104,10 +104,10 @@ const char* ffDetectEditor(FFEditorResult* result) {
|
||||
}
|
||||
|
||||
if (result->version.length > 0) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const char* param = NULL;
|
||||
const char* param = nullptr;
|
||||
if (
|
||||
ffStrbufEqualS(&result->exe, "nano") ||
|
||||
ffStrbufEqualS(&result->exe, "vim") ||
|
||||
@@ -130,24 +130,24 @@ const char* ffDetectEditor(FFEditorResult* result) {
|
||||
ffStrbufEqualS(&result->exe, "ne")) {
|
||||
param = "-h";
|
||||
} else {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ffProcessAppendStdOut(&result->version, (char* const[]) {
|
||||
result->path.chars,
|
||||
(char*) param,
|
||||
NULL,
|
||||
nullptr,
|
||||
});
|
||||
|
||||
if (result->version.length == 0) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ffStrbufSubstrBeforeFirstC(&result->version, '\n');
|
||||
const char* versionStart = strpbrk(result->version.chars, "0123456789");
|
||||
if (versionStart != NULL) {
|
||||
if (versionStart != nullptr) {
|
||||
const char* versionEnd = strpbrk(versionStart, " \t\v\f\r");
|
||||
if (versionEnd != NULL) {
|
||||
if (versionEnd != nullptr) {
|
||||
ffStrbufSubstrBefore(&result->version, (uint32_t) (versionEnd - result->version.chars));
|
||||
}
|
||||
|
||||
@@ -156,5 +156,5 @@ const char* ffDetectEditor(FFEditorResult* result) {
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user