GNOME Bugzilla – Bug 676275
Fix launching applications with filename arguments
Last modified: 2017-11-22 08:54:36 UTC
Since the switch from gdk_spawn API to nautilus_launch in b569d2cf external bulk rename tool invokation is broken for files with Umlaut (and possibly other non-ASCII) characters in their name or encoded URI. In fact, this seems to be a symptom of a more general problem. Since the move to GAppInfo API, nautilus_launch_application_from_command* is more or less forwarded to g_app_info_create_from_commandline(). That basically means that the command and all parameters are treated as if they were taken from a .desktop Exec key. However, the exec key has different quoting rules than the shell. In particular, the '%' character that often appears in URIs of files with special characters in their names gets stripped if not properly encoded.
Created attachment 214278 [details] [review] Fix launching applications with filename arguments Since the move to GAppInfo APIs as launcher backends, not shell-quoting, but fd.o .desktop Exec key quoting rules must be applied. Failing to do so resulted in broken arguments for invokations of external commands with filename arguments if those filenames (or the corresponding encoded URIs) contained reserved characers. This applies to invokations of Nautilus Scripts as well as bulk renamers.
Review of attachment 214278 [details] [review]: Thanks for the patch! ::: libnautilus-private/nautilus-program-choosing.c @@ +269,2 @@ while ((parameter = va_arg (ap, char *)) != NULL) { + quoted_parameter = desktop_exec_quote (parameter); Are you sure this change is correct also when use_terminal is true?
Holger, ping
Holger: Can you please answer comment 2?
Cosimo, is this patch still relevant? It seems Holger is never going to reply.
Alexandre, I am not sure off the top of my head. I will try to find some time to recreate the situation mentioned in the original report and test the patch.
Thanks Holger for the patch, nowadays Nautilus has a bulk rename tool inside and the code to launch a different bulk renamer is gone. Closing.