Fixed bug with DCC SEND when filename begins with '~'

This commit is contained in:
Sebastien Helleu 2006-11-14 19:54:56 +00:00
parent 3e4db5f7c1
commit 7d29001f9d
4 changed files with 10 additions and 4 deletions

View File

@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2006-11-09
ChangeLog - 2006-11-14
Version 0.2.2 (under dev!):
* fixed bug with DCC SEND when filename begins with '~'
* added "irc_send_unknown_commands" option to send unknown commands to
IRC server (OFF by default) (task #5947)
* /charset command and charset conversions now made by "charset" plugin

View File

@ -958,12 +958,14 @@ dcc_send_request (t_irc_server *server, int type, char *nick, char *filename)
if (type == DCC_FILE_SEND)
{
/* add home if filename not beginning with '/' (not for Win32) */
/* add home if filename not beginning with '/' or '~' (not for Win32) */
#ifdef _WIN32
filename2 = strdup (filename);
#else
if (filename[0] == '/')
filename2 = strdup (filename);
else if (filename[0] == '~')
filename2 = weechat_strreplace (filename, "~", getenv ("HOME"));
else
{
dir1 = weechat_strreplace (cfg_dcc_upload_path, "~", getenv ("HOME"));

View File

@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2006-11-09
ChangeLog - 2006-11-14
Version 0.2.2 (under dev!):
* fixed bug with DCC SEND when filename begins with '~'
* added "irc_send_unknown_commands" option to send unknown commands to
IRC server (OFF by default) (task #5947)
* /charset command and charset conversions now made by "charset" plugin

View File

@ -958,12 +958,14 @@ dcc_send_request (t_irc_server *server, int type, char *nick, char *filename)
if (type == DCC_FILE_SEND)
{
/* add home if filename not beginning with '/' (not for Win32) */
/* add home if filename not beginning with '/' or '~' (not for Win32) */
#ifdef _WIN32
filename2 = strdup (filename);
#else
if (filename[0] == '/')
filename2 = strdup (filename);
else if (filename[0] == '~')
filename2 = weechat_strreplace (filename, "~", getenv ("HOME"));
else
{
dir1 = weechat_strreplace (cfg_dcc_upload_path, "~", getenv ("HOME"));