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: invalid file path if it contains commas/periods/semicolons #5539

Closed
wants to merge 1 commit into from
Closed

Fix: invalid file path if it contains commas/periods/semicolons #5539

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 15, 2023

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).

If a file contains one of these characters in its name as a delimiter for another path, the program will open an invalid path.
For example: "/path/to/file",   would open as: /path/to/file",
Now also truncates commas, periods and semicolons.
@ghost ghost closed this by deleting the head repository Jan 16, 2023
This pull request was closed.
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.

gf misbehaves on paths surrounded by quotes
1 participant