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

File writer doesn't work with placeholders when the output has a directory path #57

Closed
Tom-Shaw opened this issue Jul 9, 2023 · 0 comments

Comments

@Tom-Shaw
Copy link

Tom-Shaw commented Jul 9, 2023

if ((prefixPos = this->output.find("%i")) != std::string::npos) {

WriterFile.cpp from line 82 to 133 looks within this->output for placeholders and sets prefixPos and suffixPos accordingly.

However, later on in the file the prefixPos and suffixPos variables are used to index into fileNameMask. This only works if this->output is the same as fileNameMask, i.e. if there is no directory part in the output parameter. If there is a directory part, it doesn't work - it either crashes or fails silently to create and write to the output file.

The fix is to replace this->output with fileNameMask from lines 82 to 133 of WriterFile.cpp.

@bersler bersler closed this as completed in 6f8bc33 Aug 1, 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

No branches or pull requests

1 participant