better error handling

This commit is contained in:
Linus Dierheimer
2021-02-19 16:23:41 +01:00
parent c5a9b9d428
commit a8f165e5c9
19 changed files with 277 additions and 78 deletions
+8 -1
View File
@@ -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);
}