mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-04 20:24:19 +01:00
24 lines
497 B
C
24 lines
497 B
C
#include "fastfetch.h"
|
|
|
|
#include <string.h>
|
|
|
|
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)
|
|
shellName = shellPath;
|
|
else if(shellName[0] == '/')
|
|
++shellName;
|
|
|
|
ffPrintLogoAndKey(state, "Shell");
|
|
puts(shellName);
|
|
} |