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

#186: Exporter's filename validations #255

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

rds1983
Copy link
Contributor

@rds1983 rds1983 commented Nov 26, 2023

This PR adds 3 checks for the exporter filename:

  1. The filename doesnt contain invalid characters.
  2. The file can be opened for writing.
  3. Prepends "res://" if the filename is simple(it doesnt contain folder delimiter or ':' characters).

Fixes #186

// Simple file name validation
static String bad_chars = "!@%^*~|\"";
for (int i = 0; i < bad_chars.length(); ++i)
{
Copy link
Owner

@TokisanGames TokisanGames Nov 27, 2023

Choose a reason for hiding this comment

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

I'm going to make changes so I can get this merged in. In the future, please format with braces on the same line and opt for snake case, except in class names. See formatting in https://github.com/TokisanGames/Terrain3D/blob/0.9/CONTRIBUTING.md.

Also make sure to install the clang hooks.

@TokisanGames
Copy link
Owner

TokisanGames commented Nov 27, 2023

Ok, looks good. I added some other updates that needed to be made. Thank you!

@TokisanGames TokisanGames merged commit 4682b7c into TokisanGames:main Nov 27, 2023
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.

Export_image crashes on unwritable filename
2 participants