Revision: 9099 https://osdn.net/projects/ttssh2/scm/svn/commits/9099 Author: zmatsuo Date: 2020-12-20 21:15:22 +0900 (Sun, 20 Dec 2020) Log Message: ----------- GetRecievePath() を TFileVarProto に追加 Modified Paths: -------------- trunk/teraterm/teraterm/filesys_proto.cpp trunk/teraterm/teraterm/filesys_proto.h trunk/teraterm/ttpfile/bplus.c trunk/teraterm/ttpfile/kermit.c trunk/teraterm/ttpfile/quickvan.c trunk/teraterm/ttpfile/ymodem.c trunk/teraterm/ttpfile/zmodem.c -------------- next part -------------- Modified: trunk/teraterm/teraterm/filesys_proto.cpp =================================================================== --- trunk/teraterm/teraterm/filesys_proto.cpp 2020-12-20 12:15:10 UTC (rev 9098) +++ trunk/teraterm/teraterm/filesys_proto.cpp 2020-12-20 12:15:22 UTC (rev 9099) @@ -151,6 +151,17 @@ return f; } +/** + * \x83_\x83E\x83\x93\x83\x8D\x81[\x83h\x83p\x83X\x82\xF0\x8E擾 + * + * @return \x8E\xF3\x90M\x83t\x83H\x83\x8B\x83_(\x8FI\x92[\x82Ƀp\x83X\x83Z\x83p\x83\x8C\x81[\x83^'\\'\x82\xAA\x95t\x89\xC1\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9) + * \x95s\x97v\x82ɂȂ\xC1\x82\xBD\x82\xE7 free() \x82\xB7\x82邱\x82\xC6 + */ +static char *GetRecievePath(struct FileVarProto *fv) +{ + return _strdup(fv->RecievePath); +} + static void FTSetTimeOut(PFileVarProto fv, int T) { KillTimer(fv->HMainWin, IdProtoTimer); @@ -184,6 +195,7 @@ fv->file = FilesysCreateWin32(); fv->GetNextFname = GetNextFname; + fv->GetRecievePath = GetRecievePath; fv->FTSetTimeOut = FTSetTimeOut; fv->InitDlgProgress = _InitDlgProgress; Modified: trunk/teraterm/teraterm/filesys_proto.h =================================================================== --- trunk/teraterm/teraterm/filesys_proto.h 2020-12-20 12:15:10 UTC (rev 9098) +++ trunk/teraterm/teraterm/filesys_proto.h 2020-12-20 12:15:22 UTC (rev 9099) @@ -31,7 +31,7 @@ #include "filesys_io.h" typedef struct FileVarProto { - // protosys_proto.cpp\x93\xE0\x82̂ݎg\x97p + // \x81\xABprotosys_proto.cpp\x93\xE0\x82̂ݎg\x97p WORD OpId; HWND HMainWin; @@ -46,6 +46,9 @@ // \x8E\xF3\x90M char *RecievePath; // \x8E\xF3\x90M\x83t\x83H\x83\x8B\x83_(\x8FI\x92[\x82Ƀp\x83X\x83Z\x83p\x83\x8C\x81[\x83^'\\'\x82\xAA\x95t\x89\xC1\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9) + // \x81\xAAprotosys_proto.cpp\x93\xE0\x82̂ݎg\x97p + + // \x81\xAB\x8Ae\x83v\x83\x8D\x83g\x83R\x83\x8B\x82Ŏg\x97p\x82\xB7\x82郏\x81[\x83N BOOL FileOpen; LONG FileSize, ByteCount; BOOL OverWrite; @@ -60,9 +63,11 @@ DWORD StartTime; DWORD FileMtime; + // \x81\xAA\x8Ae\x83v\x83\x8D\x83g\x83R\x83\x8B\x82Ŏg\x97p\x82\xB7\x82郏\x81[\x83N // services char *(*GetNextFname)(struct FileVarProto *fv); + char *(*GetRecievePath)(struct FileVarProto *fv); void (*FTSetTimeOut)(struct FileVarProto *fv, int T); // protocol entrys, data Modified: trunk/teraterm/ttpfile/bplus.c =================================================================== --- trunk/teraterm/ttpfile/bplus.c 2020-12-20 12:15:10 UTC (rev 9098) +++ trunk/teraterm/ttpfile/bplus.c 2020-12-20 12:15:22 UTC (rev 9099) @@ -606,6 +606,7 @@ // char Temp[HostNameMaxLength + 1]; // 81(yutaka) char Temp[81]; // 81(yutaka) TFileIO *fileio = fv->file; + char *RecievePath; switch (bv->PktIn[2]) { case 'C': /* Close */ @@ -641,8 +642,10 @@ } Temp[j] = 0; + RecievePath = fv->GetRecievePath(fv); free((void *)bv->FullName); - bv->FullName = fileio->GetRecieveFilename(fileio, fv->RecievePath, FALSE, Temp, !fv->OverWrite); + bv->FullName = fileio->GetRecieveFilename(fileio, RecievePath, FALSE, Temp, !fv->OverWrite); + free(RecievePath); /* file open */ @@ -689,8 +692,10 @@ } Temp[j] = 0; + RecievePath = fv->GetRecievePath(fv); free((void *)bv->FullName); - bv->FullName = fileio->GetRecieveFilename(fileio, Temp, FALSE, fv->RecievePath, !fv->OverWrite); + bv->FullName = fileio->GetRecieveFilename(fileio, Temp, FALSE, RecievePath, !fv->OverWrite); + free(RecievePath); /* file open */ if (! BPOpenFileToBeSent(fv)) Modified: trunk/teraterm/ttpfile/kermit.c =================================================================== --- trunk/teraterm/ttpfile/kermit.c 2020-12-20 12:15:10 UTC (rev 9098) +++ trunk/teraterm/ttpfile/kermit.c 2020-12-20 12:15:22 UTC (rev 9099) @@ -1465,6 +1465,7 @@ (kv->KmtState==GetInit)) { TFileIO *file = fv->file; + char *RecievePath; kv->KmtMode = IdKmtReceive; free((void *)kv->FullName); @@ -1473,7 +1474,9 @@ Len = sizeof(FNBuff); KmtDecode(fv,kv,FNBuff,&Len); FNBuff[Len] = 0; - kv->FullName = file->GetRecieveFilename(file, FNBuff, FALSE, fv->RecievePath, !fv->OverWrite); + RecievePath = fv->GetRecievePath(fv); + kv->FullName = file->GetRecieveFilename(file, FNBuff, FALSE, RecievePath, !fv->OverWrite); + free(RecievePath); /* file open */ if (! FTCreateFile(fv)) return FALSE; kv->KmtState = ReceiveData; Modified: trunk/teraterm/ttpfile/quickvan.c =================================================================== --- trunk/teraterm/ttpfile/quickvan.c 2020-12-20 12:15:10 UTC (rev 9098) +++ trunk/teraterm/ttpfile/quickvan.c 2020-12-20 12:15:22 UTC (rev 9099) @@ -448,6 +448,7 @@ int i; WORD w; BYTE b; + char *RecievePath; if ((qv->QVState != QV_RecvInit2) && (qv->QVState != QV_RecvNext)) @@ -454,8 +455,10 @@ return TRUE; /* file name */ + RecievePath = fv->GetRecievePath(fv); free((void *)qv->FullName); - qv->FullName = file->GetRecieveFilename(file, &(qv->PktIn[5]), FALSE, fv->RecievePath, !fv->OverWrite); + qv->FullName = file->GetRecieveFilename(file, &(qv->PktIn[5]), FALSE, RecievePath, !fv->OverWrite); + free(RecievePath); /* file open */ if (! FTCreateFile(fv)) return FALSE; /* file size */ Modified: trunk/teraterm/ttpfile/ymodem.c =================================================================== --- trunk/teraterm/ttpfile/ymodem.c 2020-12-20 12:15:10 UTC (rev 9098) +++ trunk/teraterm/ttpfile/ymodem.c 2020-12-20 12:15:22 UTC (rev 9099) @@ -646,6 +646,7 @@ int ret; BYTE *p; char *name, *nameend; + char *RecievePath; p = (BYTE *)malloc(yv->__DataLen + 1); memset(p, 0, yv->__DataLen + 1); @@ -652,8 +653,10 @@ memcpy(p, &(yv->PktIn[3]), yv->__DataLen); name = p; + RecievePath = fv->GetRecievePath(fv); free((void *)yv->FullName); - yv->FullName = file->GetRecieveFilename(file, name, FALSE, fv->RecievePath, !fv->OverWrite); + yv->FullName = file->GetRecieveFilename(file, name, FALSE, RecievePath, !fv->OverWrite); + free(RecievePath); if (!FTCreateFile(fv)) { free(p); return FALSE; Modified: trunk/teraterm/ttpfile/zmodem.c =================================================================== --- trunk/teraterm/ttpfile/zmodem.c 2020-12-20 12:15:10 UTC (rev 9098) +++ trunk/teraterm/ttpfile/zmodem.c 2020-12-20 12:15:22 UTC (rev 9099) @@ -1077,6 +1077,7 @@ int mode; int ret; TFileIO* file = fv->file; + char *RecievePath; if ((zv->ZState != Z_RecvInit) && (zv->ZState != Z_RecvInit2)) return FALSE; @@ -1087,8 +1088,11 @@ /* file name */ zv->PktIn[zv->PktInPtr] = 0; /* for safety */ + RecievePath = fv->GetRecievePath(fv); free((void *)zv->FullName); - zv->FullName = file->GetRecieveFilename(file, zv->PktIn, FALSE, fv->RecievePath, !fv->OverWrite); + zv->FullName = file->GetRecieveFilename(file, zv->PktIn, FALSE, RecievePath, !fv->OverWrite); + free(RecievePath); + /* file open */ if (!FTCreateFile(fv)) return FALSE;