dont print line if format evaluates to an empty string

This commit is contained in:
Linus Dierheimer
2021-03-27 15:39:56 +01:00
parent 055804a055
commit beb2e9608c
16 changed files with 120 additions and 147 deletions
+7 -13
View File
@@ -43,28 +43,22 @@ void ffPrintWM(FFinstance* instance)
closedir(proc);
if(!found)
{
ffPrintError(instance, "WM", "No process name matches the name of known display managers");
return;
}
if(instance->config.wmFormat.length == 0)
{
if(!found)
{
ffPrintError(instance, "WM", "No process name matches the name of known display managers");
return;
}
ffPrintLogoAndKey(instance, "WM");
ffStrbufPutTo(&name, stdout);
}
else
{
FF_STRBUF_CREATE(wm);
ffParseFormatString(&wm, &instance->config.wmFormat, 1,
ffPrintFormatString(instance, "WM", &instance->config.wmFormat, 1,
(FFformatarg){FF_FORMAT_ARG_TYPE_STRBUF, &name}
);
ffPrintLogoAndKey(instance, "WM");
ffStrbufPutTo(&wm, stdout);
ffStrbufDestroy(&wm);
}
ffStrbufDestroy(&name);