Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix computation for _overrideCLASSMethod_foo in GSTheme.m #325

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

mclarenlabs
Copy link
Contributor

  • start of string is (name+9)
  • 'ptr' is the end of the desired substring, so the length should be (ptr - (name + 9)) which is (ptr - name) - 9)

Looks like there was an implementation prior to 2010 that used this arithmetic.

Uncovered when I began a holiday project to update Rik.theme to compile with clang.
Test this modification with the updated theme here
https://github.com/mclarenlabs/rik.theme

The theme still has many NSLog statements in it logging the overrides. I will remove them
when this change is confirmed and the theme tested by someone else. I've only tested with
clang on Debian12 so far, but it seems to be fine on a number of applications. The animated
"Default" button is even working.

  - start of string is (name+9)
  - 'ptr' is the end of the desired substring, so the length
    should be (ptr - (name + 9))  which is (ptr - name) - 9)
Copy link
Member

@fredkiefer fredkiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for finding this!

@fredkiefer fredkiefer merged commit a8018d6 into gnustep:master Jan 3, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants