Skip to content

Logo: treat a "$" ending a line or the logo as a plain dollar - #2667

Merged
CarterLi merged 1 commit into
fastfetch-cli:devfrom
bercedev:fix/logo-trailing-dollar
Oct 23, 2026
Merged

CarterLi merged 1 commit into
fastfetch-cli:devfrom
bercedev:fix/logo-trailing-dollar

Conversation

@bercedev

Copy link
Copy Markdown
Contributor

Summary

A $ at the end of a logo line was treated as the start of a $N color code. The index check failed, the $ was printed, and then the newline after it was copied into the line, so the logo lost a line break and the padding of the following lines went off. A $ as the very last character also skipped past the terminating \0 and kept reading whatever was after the string. Now a $ followed by a line end or the end of the logo is printed as a plain dollar and the line end is left to the normal handling.

Related issue (required for new logos for new distros)

Fixes #2666

Changes

  • src/logo/logo.c: in the $ handling, a following \n, \r or \0 is not consumed.
  • tests/logo.c: ab$\ncd keeps its line break (height 1, width 3), ab$ stops at the terminator (width 3), and a$1b$$c is unchanged.

Screenshots

No screenshot; checked through the logo test. Before the fix the same inputs gave height 0 / width 4 for ab$\ncd and width 5 for ab$.

Checklist

  • I have tested my changes locally.

@CarterLi
CarterLi merged commit bfe74b8 into fastfetch-cli:dev Oct 23, 2026
26 checks passed
@bercedev
bercedev deleted the fix/logo-trailing-dollar branch October 23, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Dollar sign on end of line of ASCII logo breaks logo padding

2 participants