Mercurial > pidgin.yaz
changeset 11934:525cf7ecd919
[gaim-migrate @ 14225]
SF Patch #1343380 from Richard Gobeille
'This patch should fix a bug preventing files with ".."
in the filename from being sent. For example,
previously an error would have been thrown when
attempting to transfer a file named something like
"204-bruce_dickinson-no_way_out...to_be_continued.mp3"'
With a change from me... Windows allows both / and \ as path separators, so we need to check for both.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Mon, 31 Oct 2005 20:35:59 +0000 |
parents | 1b0c83666f98 |
children | cb73483c9f63 |
files | src/ft.c |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ft.c Mon Oct 31 20:33:13 2005 +0000 +++ b/src/ft.c Mon Oct 31 20:35:59 2005 +0000 @@ -416,7 +416,11 @@ if (type == GAIM_XFER_SEND) { /* Check the filename. */ - if (g_strrstr(filename, "..")) { +#ifdef _WIN32 + if (g_strrstr(filename, "../") || g_strrstr(filename, "..\\")) { +#else + if (g_strrstr(filename, "../")) { +#endif char *utf8 = g_filename_to_utf8(filename, -1, NULL, NULL, NULL); msg = g_strdup_printf(_("%s is not a valid filename.\n"), utf8);