Fix: invalid file path if it contains commas/periods/semicolons #5539
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #5533
If a file contains one of these characters (",.;") , the program will open an invalid path.
For example:
"/path/to/file",
would open as:/path/to/file",
because the comma blocked deletion of the quote.Now commas, periods and semicolons also truncate.
This covers 99% cases. However, there are still problems if you don't have space after delimiter.
"/path/to/file","path/to/file2"
It will be read as one long path, and the middle comma will not separate the path.
Also it's possible to go left and right from the current cursor position and find the first "not path related" chars and truncate the rest.
In any case, there will be cases where both algorithms won't be able to do anything. For example, if the path contains spaces in the naming (common on Windows).