We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2567

Summary: x11: Local dropped files are not URI-decoded
Product: SDL Reporter: Melker Narikka <meklu>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: x86_64   
OS: Linux   
Attachments: decode local file URIs

Description Melker Narikka 2014-06-02 09:42:44 UTC
Created attachment 1667 [details]
decode local file URIs

Local files that are dropped onto a window under X11
are not going through a URI decoding step, resulting in the following
in my test application[1]:

Dropped file /home/meklu/Pictures/Screenshot%20from%202013-10-30%2014:04:50.png
Couldn't load /home/meklu/Pictures/Screenshot%20from%202013-10-30%2014:04:50.png

Expected result:

Dropped file /home/meklu/Pictures/Screenshot from 2013-10-30 14:04:50.png
Loaded /home/meklu/Pictures/Screenshot from 2013-10-30 14:04:50.png successfully

I've attached a patch that fixes the issue by doing URI decoding in-place on
the file string buffer.

[1]: http://meklu.org/code/glimgblur.tar.xz
Comment 1 Sam Lantinga 2014-06-16 01:31:54 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/cd1113741ade