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

Add very little sanitization to indentifier names in ExportDataAsCode() #3832

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

Dev-Tade
Copy link
Contributor

Hello, I decided to add this little sanitization for the '-' characater to the exported identifiers since find it quite useful for me and may help to other raylib users that use '-' in their file names.

Without this change any exported data to a file name containing the character would not compile since it's not a valid character for identifiers, I could have added more characters to be replaced ('@', '#', '%', etc) but i don't think they are really used for the use cases of ExportDataAsCode().

Thanks for your time ❤️

@raysan5 raysan5 merged commit c588a29 into raysan5:master Feb 26, 2024
@raysan5
Copy link
Owner

raysan5 commented Feb 26, 2024

@Dev-Tade Thanks for the review, I was a bit reticent about this change but I will merge this one. Still, it will require some review and also alignment wit all the other Export*AsCode() functions in raylib.

@Dev-Tade
Copy link
Contributor Author

I was thinking on adding a function for converting the name to uppercase and also sanitize so it could be reusable but didn't feel like, since my problem was with DataAsCode but I agree the other variants of exporting as code would need review and possibly require sanitization.

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.

2 participants