mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 10:52:08 +02:00
refactored project structure
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#include "fastfetch.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
void ffPrintShell(FFstate* state)
|
||||
{
|
||||
if(ffPrintCachedValue(state, "Shell"))
|
||||
return;
|
||||
|
||||
char* shellPath = getenv("SHELL");
|
||||
if(shellPath == NULL)
|
||||
{
|
||||
ffPrintError(state, "Shell", "getenv(\"SHELL\") == NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
char* shellName = strrchr(shellPath, '/');
|
||||
|
||||
if(shellName == NULL)
|
||||
shellName = shellPath;
|
||||
else if(shellName[0] == '/')
|
||||
++shellName;
|
||||
|
||||
ffPrintAndSaveCachedValue(state, "Shell", shellName);
|
||||
}
|
||||
Reference in New Issue
Block a user