1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

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.)
This commit is contained in:
Witold Filipczyk 2008-01-08 22:00:19 +01:00 committed by Kalle Olavi Niemitalo
parent a6966e9472
commit 19079733df

View File

@ -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);
}