Skip to content

Commit

Permalink
Logo (Builtin): split ID_LIKE before using
Browse files Browse the repository at this point in the history
Fix #1540
  • Loading branch information
CarterLi committed Feb 7, 2025
1 parent 1d21d02 commit f2755a8
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions src/logo/logo.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,30 @@ static const FFlogo* logoGetBuiltinDetected(FFLogoSize size)
if(logo != NULL)
return logo;

logo = logoGetBuiltin(&os->prettyName, size);
if(logo != NULL)
return logo;
if (ffStrbufContainC(&os->idLike, ' '))
{
FF_STRBUF_AUTO_DESTROY buf = ffStrbufCreate();
for (
uint32_t start = 0, end = ffStrbufFirstIndexC(&os->idLike, ' ');
true;
start = end + 1, end = ffStrbufNextIndexC(&os->idLike, start, ' ')
)
{
ffStrbufSetNS(&buf, end - start, os->idLike.chars + start);
logo = logoGetBuiltin(&buf, size);
if(logo != NULL)
return logo;

logo = logoGetBuiltin(&os->idLike, size);
if(logo != NULL)
return logo;
if (end >= os->idLike.length)
break;
}
}
else
{
logo = logoGetBuiltin(&os->idLike, size);
if(logo != NULL)
return logo;
}

logo = logoGetBuiltin(&instance.state.platform.sysinfo.name, size);
if(logo != NULL)
Expand Down

0 comments on commit f2755a8

Please sign in to comment.