diff options
-rw-r--r-- | utilities.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/utilities.cpp b/utilities.cpp index e14cfc0..82a30bf 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -359,9 +359,9 @@ int onProtoAck(WPARAM w, LPARAM l) //from secureim partially int onSendFile(WPARAM w, LPARAM l) { - CCSDATA *ccs=(CCSDATA*)l; if(!bFileTransfers) return CallService(MS_PROTO_CHAINSEND, w, l); + CCSDATA *ccs=(CCSDATA*)l; if(isContactSecured(ccs->hContact)) { TCHAR **file=(TCHAR **)ccs->lParam; @@ -370,6 +370,9 @@ int onSendFile(WPARAM w, LPARAM l) { if (_tcsstr(file[i],_T(".gpg"))) continue; + if(_waccess(file[i], 0) == -1) + if(errno == ENOENT) + return 0; //we do not want to send file unencrypted (sometimes ack have wrong info) TCHAR *name = _tcsrchr(file[i],_T('\\')); if( !name ) name = file[i]; @@ -389,7 +392,7 @@ int onSendFile(WPARAM w, LPARAM l) mir_free(szKeyid); mir_free(keyid); cmd += _T(" -o \""); - TCHAR *temp = _wgetenv(_T("TEMP")); + TCHAR *temp = _tgetenv(_T("TEMP")); cmd += temp; cmd += _T("\\"); cmd += file_out; @@ -436,8 +439,10 @@ int onSendFile(WPARAM w, LPARAM l) } } } - mir_free(file[i]); - file[i]=mir_tstrdup(path_out.c_str()); +// mir_free(file[i]); +// file[i] = mir_tstrdup(path_out.c_str()); + mir_realloc(file[i], path_out.length()*sizeof(TCHAR)+1); + _tcscpy(file[i], path_out.c_str()); delete [] file_out; transfers.push_back(path_out); } |