diff options
author | Timo Sirainen <cras@irssi.org> | 2002-11-17 15:27:55 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-11-17 15:27:55 +0000 |
commit | f167270a6b0fa0a01f74713e4997600e39472b1a (patch) | |
tree | ecffaacd1aa387e94b263968486b46a0b2362979 /src | |
parent | 3182ac0d01ac2af862a9889a9bfca266f5a3a5e3 (diff) | |
download | irssi-f167270a6b0fa0a01f74713e4997600e39472b1a.zip |
If /DCC SEND file isn't found, complain about it
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3004 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/irc/dcc/dcc-send.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/irc/dcc/dcc-send.c b/src/irc/dcc/dcc-send.c index 25545a05..5b427986 100644 --- a/src/irc/dcc/dcc-send.c +++ b/src/irc/dcc/dcc-send.c @@ -98,8 +98,15 @@ static void dcc_send_add(const char *servertag, CHAT_DCC_REC *chat, /* add all globbed files to a proper queue */ for (i = 0; i < globbuf.gl_pathc; i++) { - if (stat(globbuf.gl_pathv[i], &st) == 0 && - S_ISREG(st.st_mode) && st.st_size > 0) { + const char *fname = globbuf.gl_pathv[i]; + + if (stat(fname, &st) != 0) { + signal_emit("dcc error file open", 3, + nick, fname, errno); + continue; + } + + if (S_ISREG(st.st_mode) && st.st_size > 0) { if (queue < 0) { /* in append and prepend mode try to find an old queue. if an old queue is not found @@ -115,7 +122,7 @@ static void dcc_send_add(const char *servertag, CHAT_DCC_REC *chat, } dcc_queue_add(queue, add_mode, nick, - globbuf.gl_pathv[i], servertag, chat); + fname, servertag, chat); files++; } } |