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
This commit is contained in:
Timo Sirainen 2002-11-17 15:27:55 +00:00 committed by cras
commit f167270a6b

View file

@ -98,8 +98,15 @@ static void dcc_send_add(const char *servertag, CHAT_DCC_REC *chat,
/* add all globbed files to a proper queue */ /* add all globbed files to a proper queue */
for (i = 0; i < globbuf.gl_pathc; i++) { for (i = 0; i < globbuf.gl_pathc; i++) {
if (stat(globbuf.gl_pathv[i], &st) == 0 && const char *fname = globbuf.gl_pathv[i];
S_ISREG(st.st_mode) && st.st_size > 0) {
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) { if (queue < 0) {
/* in append and prepend mode try to find an /* in append and prepend mode try to find an
old queue. if an old queue is not found 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, dcc_queue_add(queue, add_mode, nick,
globbuf.gl_pathv[i], servertag, chat); fname, servertag, chat);
files++; files++;
} }
} }