! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Thunar fails to quote filenames while expanding %F in a .desktop file when Te...
Status:
RESOLVED: FIXED

Comments

Description David Mohr 2009-03-21 15:11:07 CET
When Terminal=false in the .desktop files, %F is expanded properly, and filenames with spaces appear correctly as one argumnet to the executing application.

But when Terminal=true, somehow the expansion fails, and the application sees filenames with spaces split as two (or more) arguments.
Comment 1 David Mohr 2009-03-21 15:13:54 CET
Created attachment 2247 
Shell script to be executed by the .desktop file
Comment 2 David Mohr 2009-03-21 15:14:19 CET
Created attachment 2248 
.desktop file which triggers the bug
Comment 3 David Mohr 2009-03-21 15:16:46 CET
Created attachment 2249 
Empty test file to download

If you save all three attachments (.sh, .desktop, and this empty test file with spaces) in the same directory, and drag the empty file onto the .desktop, you'll see a terminal window popping up where three arguments are recognized, instead of just one.
Comment 4 David Mohr 2009-03-21 17:22:18 CET
So thunar just executes: exo-open --launch TerminalEmulator ./quoting-test.sh '/home/squisher/usr/xftasklets/bugs/New Empty File' , quoted correctly. So the bug is in exo-open.
Comment 5 David Mohr 2009-03-21 18:30:41 CET
Created attachment 2250 
Patch which quotes the arguments

Attached is a patch which quotes the arguments when joining them into one string. I think it is pretty straight forward.

This should be save because exo-helper will parse the commands again with g_shell_parse_argv (exo-helper.c:416), which takes care of removing the quotes again to properly pass on the args to gdk_spawn_on_screen.
Comment 6 Nick Schermer editbugs 2009-03-21 19:42:11 CET
Created attachment 2251 
Quote arguments in exo-open

Patch idea is good, but it's horrible to read. Could you try the attached patch?
Comment 7 David Mohr 2009-03-22 05:04:21 CET
Yes, works fine. Thanks Nick!
Comment 8 Nick Schermer editbugs 2009-03-22 09:09:37 CET
Committed in revision 29679.

Bug #5132

Reported by:
David Mohr
Reported on: 2009-03-21
Last modified on: 2009-10-09

People

Assignee:
Nick Schermer
CC List:
1 user

Version

Version:
0.3.100

Attachments

Shell script to be executed by the .desktop file (149 bytes, text/x-sh)
2009-03-21 15:13 CET , David Mohr
no flags
.desktop file which triggers the bug (184 bytes, application/octet-stream)
2009-03-21 15:14 CET , David Mohr
no flags
Empty test file to download (6 bytes, application/octet-stream)
2009-03-21 15:16 CET , David Mohr
no flags
Patch which quotes the arguments (1.28 KB, patch)
2009-03-21 18:30 CET , David Mohr
no flags
Quote arguments in exo-open (1.48 KB, patch)
2009-03-21 19:42 CET , Nick Schermer
no flags

Additional information