GNOME Bugzilla – Bug 155386
GnomeVFSMimeApplication command contains " "
Last modified: 2004-12-22 21:47:04 UTC
When writing a patch for gnome-panel-screenshot I realized that when getting application list for a concrete MIME type, the command field could contain an empty space: From eog.desktop, where: Exec=eog %U application->command is "eog ", so trying to use that string in, for example, g_spawn_async ends with a "not found" error. A possible fix would be - *p = '\0'; + *(p - 1) = '\0'; but this for example would not catch the "bug-buddy --core" example. So maybe the solution is always use ->command as a command line string. Is this the right thing?
*** Bug 155773 has been marked as a duplicate of this bug. ***
TThe GnomeVFSMimeApplication abstraction is a part of an older system that extracted the command argument as a separate thing. The new code takes the Exec field from the desktop file and tries to make up the old-style command line. Anyway, you can't (and couldn't even in the old system) assume application->command is just a binary name. Its a command line, including arguments.
Long term we want to get rid of GnomeVFSMimeApplication and rely more on desktop files and the new mime specifications.
Since ->command is a command line I'm going to wontfix. In new code get_exec should be used or where possible use launch api directly.