mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-27 23:30:47 +01:00
TerminalShell: clears version buffer if detection failed
This commit is contained in:
@@ -429,7 +429,9 @@ const FFShellResult* ffDetectShell() {
|
||||
if (result->processName.length > 0) {
|
||||
setShellInfoDetails(result);
|
||||
if (instance.config.general.detectVersion) {
|
||||
fftsGetShellVersion(result->exePath.length > 0 ? &result->exePath : &result->exe, result->exeName, &result->version);
|
||||
if (!fftsGetShellVersion(result->exePath.length > 0 ? &result->exePath : &result->exe, result->exeName, &result->version)) {
|
||||
ffStrbufClear(&result->version);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -484,7 +486,9 @@ const FFTerminalResult* ffDetectTerminal() {
|
||||
if (result->processName.length > 0) {
|
||||
setTerminalInfoDetails(result);
|
||||
if (instance.config.general.detectVersion) {
|
||||
fftsGetTerminalVersion(&result->processName, result->exePath.length > 0 ? &result->exePath : &result->exe, &result->version);
|
||||
if (!fftsGetTerminalVersion(&result->processName, result->exePath.length > 0 ? &result->exePath : &result->exe, &result->version)) {
|
||||
ffStrbufClear(&result->version);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -354,7 +354,9 @@ const FFShellResult* ffDetectShell(void) {
|
||||
*ext = '\0';
|
||||
}
|
||||
if (instance.config.general.detectVersion) {
|
||||
fftsGetShellVersion(result->exePath.length > 0 ? &result->exePath : &result->exe, tmp, &result->version);
|
||||
if (!fftsGetShellVersion(result->exePath.length > 0 ? &result->exePath : &result->exe, tmp, &result->version)) {
|
||||
ffStrbufClear(&result->version);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -415,7 +417,9 @@ const FFTerminalResult* ffDetectTerminal(void) {
|
||||
if (result->processName.length > 0) {
|
||||
setTerminalInfoDetails(result);
|
||||
if (instance.config.general.detectVersion) {
|
||||
fftsGetTerminalVersion(&result->processName, result->exePath.length > 0 ? &result->exePath : &result->exe, &result->version);
|
||||
if (!fftsGetTerminalVersion(&result->processName, result->exePath.length > 0 ? &result->exePath : &result->exe, &result->version)) {
|
||||
ffStrbufClear(&result->version);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user