mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-08 06:00:08 +01:00
better error handling
This commit is contained in:
+8
-1
@@ -5,6 +5,13 @@
|
||||
void ffPrintShell(FFstate* state)
|
||||
{
|
||||
char* shellPath = getenv("SHELL");
|
||||
if(shellPath == NULL)
|
||||
{
|
||||
if(state->showErrors)
|
||||
ffPrintError(state, "Shell", "getenv(\"SHELL\") == NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
char* shellName = strrchr(shellPath, '/');
|
||||
|
||||
if(shellName == NULL)
|
||||
@@ -13,5 +20,5 @@ void ffPrintShell(FFstate* state)
|
||||
++shellName;
|
||||
|
||||
ffPrintLogoAndKey(state, "Shell");
|
||||
printf("%s\n", shellName);
|
||||
puts(shellName);
|
||||
}
|
||||
Reference in New Issue
Block a user