Closed zhuyaliang closed 10 months ago
@cwendling Do you accept the repair method?
Does this actually fix the issue, even for a file named foo#bar
? Can't you use g_uri_escape_string()
which should be more robust?
@cwendling I confirm that the issue has been fixed. The problem only occurs when the first character in the string is a special character,I use g_uri_escape_string (name, G_URI_RESERVED_CHARS_GENERIC_DELIMITERS, FALSE)
failed to solve the issue
Can you tell me the correct usage of g_uri_escape string
?
Does this actually fix the issue, even for a file named foo#bar?
It is indeed possible to handle this format of file, although it does not block, the result is abnormal
g_uri_escape string(name, NULL, TRUE)
Passing G_URI_RESERVED_CHARS_GENERIC_DELIMITERS
as reserved_chars_allowed
defeats the purpose, as it will not escape the characters that are the most important to escape :)
Looks generally better (and possibly OK).
This should be tested with all kind of file names including %
, ?
and #
in them, if possible in all possible usage scenario of these functions, yet I'm not sure yet which code paths lead to calling of those functions.
@cwendling Can we merge?
I actually took the liberty of pushing my suggested changes to the branch so others can test easier; feel free to revert to 10b0bbb9e76c24baaa3ae8639fa80dba8a6fba75 and tell me if you don't like me doing this.
…and rebased on top of 40fbfca42d7166c05e55797e73431ef7de46173b to hopefully get a green build :)
Fix #501