From 19079733dfc9d5bfa6d153cb6e19cd0c6b80b9da Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Tue, 8 Jan 2008 22:00:19 +0100 Subject: [PATCH] Bug 991: URI-decode and shell-quote file name for MIME handler Currently, when ELinks passes the name of a local file to an external MIME handler program, it encodes the name as a URI. Programs typically do not expect this, and they then fail to open the file. This patch makes ELinks instead quote the file name for the shell. (The patch was attachment 425 of bug 991, by Witold Filipczyk. This commit message was written by Kalle Olavi Niemitalo.) --- src/session/download.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/session/download.c b/src/session/download.c index 56d58c8a3..10d7eaa98 100644 --- a/src/session/download.c +++ b/src/session/download.c @@ -812,7 +812,7 @@ subst_file(unsigned char *prog, unsigned char *file) cygwin_conv_to_full_win32_path(file, new_path); add_to_string(&name, new_path); #else - add_to_string(&name, file); + add_shell_quoted_to_string(&name, file, strlen(file)); #endif prog++; } @@ -1093,6 +1093,7 @@ tp_open(struct type_query *type_query) unsigned char *handler = NULL; if (file) { + decode_uri(file); handler = subst_file(type_query->external_handler, file); mem_free(file); }