Skip to content

Commit 9b27114

Browse files
authored
Don't sanitize URI on drop (#894)
1 parent 286ab04 commit 9b27114

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/Widgets/TerminalWidget.vala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,6 @@ namespace Terminal {
835835
case DropTargets.URILIST:
836836
var uris = selection_data.get_uris ();
837837
string path;
838-
File file;
839838
for (var i = 0; i < uris.length; i++) {
840839
// Get unquoted path as some apps may drop uris that are escaped
841840
// and quoted.
@@ -846,10 +845,10 @@ namespace Terminal {
846845
warning ("Error unquoting %s. %s", uris[i], e.message);
847846
unquoted_uri = uris[i];
848847
}
849-
// Sanitize the path as we do not want the `file://` scheme included
850-
// and we assume dropped paths are absolute.
851-
file = File.new_for_uri (Utils.sanitize_path (unquoted_uri, "", false));
852-
path = file.get_path ();
848+
849+
// Get path as we do not want the `file://` scheme included
850+
// and we assume dropped paths are absolute so no need for Utils.sanitize_path
851+
path = File.new_for_uri (unquoted_uri).get_path ();
853852
if (path != null) {
854853
uris[i] = Shell.quote (path) + " ";
855854
} else {

0 commit comments

Comments
 (0)