Skip to content

Commit f8263c5

Browse files
Merge pull request livecode#7265 from livecodepanos/bugfix-22591
[22591] Fix drag-n-drop onto Mail app if filename has spaces
2 parents 801c69e + 8aa7d81 commit f8263c5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

docs/notes/bugfix-22591.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Ensure drag-n-drop of a filename with spaces onto Mail app adds the file as an attachment

engine/src/mac-clipboard.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@
250250
// Undo the transformation of spaces to '+'
251251
if (!MCStringFindAndReplace(*t_modified, MCSTR("+"), MCSTR(" "), kMCStringOptionCompareExact))
252252
return NULL;
253+
// Properly encode spaces
254+
if (!MCStringFindAndReplace(*t_modified, MCSTR(" "), MCSTR("%20"), kMCStringOptionCompareExact))
255+
return NULL;
253256

254257
// Add the required "file://" prefix to the path
255258
if (!MCStringPrepend(*t_modified, MCSTR("file://")))

0 commit comments

Comments
 (0)