• R/O
  • SSH
  • HTTPS

ttssh2: コミット


コミットメタ情報

リビジョン9467 (tree)
日時2021-10-14 23:51:47
作者zmatsuo

ログメッセージ

ファイル転送時のログをログフォルダへ出力するようにした

- bplus,kermit,quickvan,xmodem,ymodem,zmodem
- TProtoLog.LogState を各プロトコルへ移動
- ログ部分を別ファイルへ分離

- protolog.cpp,h

変更サマリ

差分

--- trunk/teraterm/teraterm/CMakeLists.txt (revision 9466)
+++ trunk/teraterm/teraterm/CMakeLists.txt (revision 9467)
@@ -190,6 +190,8 @@
190190 ../ttpfile/ftlib.h
191191 ../ttpfile/kermit.c
192192 ../ttpfile/kermit.h
193+ ../ttpfile/protolog.cpp
194+ ../ttpfile/protolog.h
193195 ../ttpfile/quickvan.c
194196 ../ttpfile/quickvan.h
195197 ../ttpfile/xmodem.c
--- trunk/teraterm/ttpfile/bplus.c (revision 9466)
+++ trunk/teraterm/ttpfile/bplus.c (revision 9467)
@@ -75,6 +75,7 @@
7575 BYTE Q[8];
7676 TProtoLog *log;
7777 const char *FullName; // Windows上のファイル名 UTF-8
78+ WORD LogState;
7879 } TBPVar;
7980 typedef TBPVar far *PBPVar;
8081
@@ -205,8 +206,9 @@
205206 if ((ts->LogFlag & LOG_BP)!=0) {
206207 TProtoLog* log = ProtoLogCreate();
207208 bv->log = log;
209+ log->SetFolderW(log, ts->LogDirW);
208210 log->Open(log, "BPLUS.LOG");
209- log->LogState = 0;
211+ bv->LogState = 0;
210212 }
211213
212214 return TRUE;
@@ -220,9 +222,9 @@
220222 if (bv->log != NULL)
221223 {
222224 TProtoLog *log = bv->log;
223- if (log->LogState==0)
225+ if (bv->LogState==0)
224226 {
225- log->LogState = 1;
227+ bv->LogState = 1;
226228 log->WriteRaw(log, "\015\012<<<\015\012", 7);
227229 }
228230 log->DumpByte(log, *b);
@@ -239,9 +241,9 @@
239241 if (bv->log != NULL && (i>0))
240242 {
241243 TProtoLog* log = bv->log;
242- if (log->LogState != 0)
244+ if (bv->LogState != 0)
243245 {
244- log->LogState = 0;
246+ bv->LogState = 0;
245247 log->WriteRaw(log,"\015\012>>>\015\012",7);
246248 }
247249 for (j=0 ; j <= i-1 ; j++)
--- trunk/teraterm/ttpfile/ftlib.c (revision 9466)
+++ trunk/teraterm/ttpfile/ftlib.c (revision 9467)
@@ -63,121 +63,3 @@
6363 CRC = CRC >> 1;
6464 return CRC;
6565 }
66-
67-//
68-// プロトコル用ログ
69-//
70-
71-static BOOL Open(TProtoLog *pv, const char *file)
72-{
73- pv->LogFile = CreateFileA(file,
74- GENERIC_WRITE, FILE_SHARE_WRITE, NULL,
75- CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
76- pv->LogCount = 0;
77- pv->LogState = 0;
78- return pv->LogFile == INVALID_HANDLE_VALUE ? FALSE : TRUE;
79-}
80-
81-static void Close(TProtoLog *pv)
82-{
83- if (pv->LogFile != INVALID_HANDLE_VALUE) {
84- if (pv->LogCount > 0) {
85- pv->DumpFlush(pv);
86- }
87- CloseHandle(pv->LogFile);
88- pv->LogFile = INVALID_HANDLE_VALUE;
89- }
90-}
91-
92-static size_t WriteRawData(struct ProtoLog *pv, const void *data, size_t len)
93-{
94- DWORD NumberOfBytesWritten;
95- BOOL result = WriteFile(pv->LogFile, data, len, &NumberOfBytesWritten, NULL);
96- if (result == FALSE) {
97- return 0;
98- }
99- return NumberOfBytesWritten;
100-}
101-
102-static size_t WriteStr(TProtoLog *pv, const char *str)
103-{
104- size_t len = strlen(str);
105- size_t r = WriteRawData(pv, str, len);
106- return r;
107-}
108-
109-static void DumpByte(TProtoLog *pv, BYTE b)
110-{
111- char d[3];
112-
113- if (pv->LogCount == _countof(pv->LogLineBuf)) {
114- pv->DumpFlush(pv);
115- }
116-
117- if (b<=0x9f)
118- d[0] = (b >> 4) + 0x30;
119- else
120- d[0] = (b >> 4) + 0x37;
121-
122- if ((b & 0x0f) <= 0x9)
123- d[1] = (b & 0x0F) + 0x30;
124- else
125- d[1] = (b & 0x0F) + 0x37;
126-
127- d[2] = 0x20;
128- pv->WriteRaw(pv,d,3);
129- pv->LogLineBuf[pv->LogCount] = b; // add (2008.6.3 yutaka)
130- pv->LogCount++;
131-}
132-
133-static void DumpFlush(TProtoLog *pv)
134-{
135- int rest = 16 - pv->LogCount;
136- int i;
137-
138- for (i = 0 ; i < rest ; i++)
139- pv->WriteRaw(pv," ", 3);
140-
141- // ASCII表示を追加 (2008.6.3 yutaka)
142- pv->WriteRaw(pv," ", 4);
143- for (i = 0 ; i < pv->LogCount ; i++) {
144- char ch[5];
145- if (isprint(pv->LogLineBuf[i])) {
146- _snprintf_s(ch, sizeof(ch), _TRUNCATE, "%c", pv->LogLineBuf[i]);
147- pv->WriteRaw(pv, ch, 1);
148-
149- } else {
150- pv->WriteRaw(pv, ".", 1);
151-
152- }
153-
154- }
155-
156- pv->LogCount = 0;
157- pv->WriteRaw(pv,"\015\012",2);
158-}
159-
160-static void ProtoLogDestroy(TProtoLog *pv)
161-{
162- pv->Close(pv);
163- free(pv);
164-}
165-
166-TProtoLog *ProtoLogCreate()
167-{
168- TProtoLog *pv = (TProtoLog *)malloc(sizeof(TProtoLog));
169- if (pv == NULL) {
170- return NULL;
171- }
172-
173- memset(pv, 0, sizeof(TProtoLog));
174- pv->Open = Open;
175- pv->Close = Close;
176- pv->WriteStr = WriteStr;
177- pv->DumpByte = DumpByte;
178- pv->DumpFlush = DumpFlush;
179- pv->WriteRaw = WriteRawData;
180- pv->Destory = ProtoLogDestroy;
181- pv->LogFile = INVALID_HANDLE_VALUE;
182- return pv;
183-}
--- trunk/teraterm/ttpfile/ftlib.h (revision 9466)
+++ trunk/teraterm/ttpfile/ftlib.h (revision 9467)
@@ -29,6 +29,8 @@
2929
3030 /* TTFILE.DLL, routines for file transfer protocol */
3131
32+#pragma once
33+
3234 #ifdef __cplusplus
3335 extern "C" {
3436 #endif
@@ -36,24 +38,8 @@
3638 WORD UpdateCRC(BYTE b, WORD CRC);
3739 LONG UpdateCRC32(BYTE b, LONG CRC);
3840
39-typedef struct ProtoLog {
40- // public
41- WORD LogState; // 自由に使っても良い変数
42- BOOL (*Open)(struct ProtoLog *pv, const char *file);
43- void (*Close)(struct ProtoLog *pv);
44- size_t (*WriteRaw)(struct ProtoLog *pv, const void *data, size_t len);
45- size_t (*WriteStr)(struct ProtoLog *pv, const char *str);
46- void (*DumpByte)(struct ProtoLog *pv, BYTE b);
47- void (*DumpFlush)(struct ProtoLog *pv);
48- void (*Destory)(struct ProtoLog *pv);
49- // private
50- HANDLE LogFile;
51- WORD LogCount;
52- BYTE LogLineBuf[16];
53-} TProtoLog;
54-
55-TProtoLog *ProtoLogCreate(void);
56-
5741 #ifdef __cplusplus
5842 }
5943 #endif
44+
45+#include "protolog.h"
--- trunk/teraterm/ttpfile/kermit.c (revision 9466)
+++ trunk/teraterm/ttpfile/kermit.c (revision 9467)
@@ -1248,8 +1248,8 @@
12481248 ctime_s(ctime_str, sizeof(ctime_str), &tm);
12491249
12501250 kv->log = log;
1251+ log->SetFolderW(log, ts->LogDirW);
12511252 log->Open(log, "KERMIT.LOG");
1252- log->LogState = 0;
12531253 _snprintf_s(buf, sizeof(buf), _TRUNCATE, "KERMIT %s start: %s\n",
12541254 kv->KmtMode == IdKmtSend ? "Send" :
12551255 kv->KmtMode == IdKmtReceive ? "Receive" :
--- trunk/teraterm/ttpfile/protolog.cpp (nonexistent)
+++ trunk/teraterm/ttpfile/protolog.cpp (revision 9467)
@@ -0,0 +1,217 @@
1+/*
2+ * (C) 2021- TeraTerm Project
3+ * All rights reserved.
4+ *
5+ * Redistribution and use in source and binary forms, with or without
6+ * modification, are permitted provided that the following conditions
7+ * are met:
8+ *
9+ * 1. Redistributions of source code must retain the above copyright
10+ * notice, this list of conditions and the following disclaimer.
11+ * 2. Redistributions in binary form must reproduce the above copyright
12+ * notice, this list of conditions and the following disclaimer in the
13+ * documentation and/or other materials provided with the distribution.
14+ * 3. The name of the author may not be used to endorse or promote products
15+ * derived from this software without specific prior written permission.
16+ *
17+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
18+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20+ * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+ */
28+
29+#include <stdio.h>
30+#include <string.h>
31+
32+#include "asprintf.h"
33+#include "codeconv.h"
34+
35+#include "protolog.h"
36+
37+typedef struct {
38+ HANDLE LogFile;
39+ WORD LogCount;
40+ BYTE LogLineBuf[16];
41+ wchar_t *Folder;
42+} PrivateData_t;
43+
44+static BOOL OpenW(struct ProtoLog *pv, const wchar_t *file)
45+{
46+ PrivateData_t *pdata = (PrivateData_t *)pv->private_data;
47+ wchar_t *full_path;
48+ if (pdata->Folder != NULL) {
49+ aswprintf(&full_path, L"%s\\%s", pdata->Folder, file);
50+ } else {
51+ full_path = _wcsdup(file);
52+ }
53+ pdata->LogFile = CreateFileW(full_path,
54+ GENERIC_WRITE, FILE_SHARE_WRITE, NULL,
55+ CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
56+ free(full_path);
57+ pdata->LogCount = 0;
58+ return pdata->LogFile == INVALID_HANDLE_VALUE ? FALSE : TRUE;
59+}
60+
61+static BOOL OpenA(TProtoLog *pv, const char *file)
62+{
63+ wchar_t *fileW = ToWcharA(file);
64+ BOOL r = OpenW(pv, fileW);
65+ free(fileW);
66+ return r;
67+}
68+
69+static BOOL OpenU8(TProtoLog *pv, const char *fileU8)
70+{
71+ wchar_t *fileW = ToWcharU8(fileU8);
72+ BOOL r = OpenW(pv, fileW);
73+ free(fileW);
74+ return r;
75+}
76+
77+static void Close(TProtoLog *pv)
78+{
79+ PrivateData_t *pdata = (PrivateData_t *)pv->private_data;
80+ if (pdata->LogFile != INVALID_HANDLE_VALUE) {
81+ if (pdata->LogCount > 0) {
82+ pv->DumpFlush(pv);
83+ }
84+ CloseHandle(pdata->LogFile);
85+ pdata->LogFile = INVALID_HANDLE_VALUE;
86+ }
87+}
88+
89+static size_t WriteRawData(struct ProtoLog *pv, const void *data, size_t len)
90+{
91+ PrivateData_t *pdata = (PrivateData_t *)pv->private_data;
92+ DWORD NumberOfBytesWritten;
93+ BOOL result = WriteFile(pdata->LogFile, data, (DWORD)len, &NumberOfBytesWritten, NULL);
94+ if (result == FALSE) {
95+ return 0;
96+ }
97+ return NumberOfBytesWritten;
98+}
99+
100+static size_t WriteStr(TProtoLog *pv, const char *str)
101+{
102+ size_t len = strlen(str);
103+ size_t r = WriteRawData(pv, str, len);
104+ return r;
105+}
106+
107+static void DumpByte(TProtoLog *pv, BYTE b)
108+{
109+ PrivateData_t *pdata = (PrivateData_t *)pv->private_data;
110+ char d[3];
111+
112+ if (pdata->LogCount == _countof(pdata->LogLineBuf)) {
113+ pv->DumpFlush(pv);
114+ }
115+
116+ if (b<=0x9f)
117+ d[0] = (b >> 4) + 0x30;
118+ else
119+ d[0] = (b >> 4) + 0x37;
120+
121+ if ((b & 0x0f) <= 0x9)
122+ d[1] = (b & 0x0F) + 0x30;
123+ else
124+ d[1] = (b & 0x0F) + 0x37;
125+
126+ d[2] = 0x20;
127+ pv->WriteRaw(pv,d,3);
128+ pdata->LogLineBuf[pdata->LogCount] = b; // add (2008.6.3 yutaka)
129+ pdata->LogCount++;
130+}
131+
132+static void NewLine(TProtoLog *pv)
133+{
134+ pv->WriteRaw(pv,"\015\012",2); // 0x0d 0x0a "\r\n"
135+}
136+
137+static void DumpFlush(TProtoLog *pv)
138+{
139+ PrivateData_t *pdata = (PrivateData_t *)pv->private_data;
140+ int rest = 16 - pdata->LogCount;
141+ int i;
142+
143+ for (i = 0 ; i < rest ; i++)
144+ pv->WriteRaw(pv," ", 3);
145+
146+ // ASCII表示を追加 (2008.6.3 yutaka)
147+ pv->WriteRaw(pv," ", 4);
148+ for (i = 0 ; i < pdata->LogCount ; i++) {
149+ char ch[5];
150+ if (isprint(pdata->LogLineBuf[i])) {
151+ _snprintf_s(ch, sizeof(ch), _TRUNCATE, "%c", pdata->LogLineBuf[i]);
152+ pv->WriteRaw(pv, ch, 1);
153+
154+ } else {
155+ pv->WriteRaw(pv, ".", 1);
156+
157+ }
158+
159+ }
160+ pdata->LogCount = 0;
161+
162+ NewLine(pv);
163+}
164+
165+static void SetFolderW(struct ProtoLog *pv, const wchar_t *folder)
166+{
167+ PrivateData_t *pdata = (PrivateData_t *)pv->private_data;
168+ if (pdata->Folder != NULL) {
169+ free(pdata->Folder);
170+ }
171+ if (folder != NULL) {
172+ pdata->Folder = _wcsdup(folder);
173+ }
174+}
175+
176+static void ProtoLogDestroy(TProtoLog *pv)
177+{
178+ PrivateData_t *pdata = (PrivateData_t *)pv->private_data;
179+ if (pdata->Folder != NULL) {
180+ free(pdata->Folder);
181+ pdata->Folder = NULL;
182+ }
183+ free(pdata);
184+ pv->private_data = NULL;
185+ pv->Close(pv);
186+ free(pv);
187+}
188+
189+TProtoLog *ProtoLogCreate()
190+{
191+ TProtoLog *pv = (TProtoLog *)calloc(sizeof(*pv), 1);
192+ if (pv == NULL) {
193+ return NULL;
194+ }
195+
196+ PrivateData_t *pdata = (PrivateData_t *)calloc(sizeof(*pdata), 1);
197+ if (pdata == NULL) {
198+ free(pv);
199+ return NULL;
200+ }
201+
202+ pv->Open = OpenA;
203+ pv->OpenA = OpenA;
204+ pv->OpenW = OpenW;
205+ pv->OpenU8 = OpenU8;
206+ pv->Close = Close;
207+ pv->SetFolderW = SetFolderW;
208+ pv->WriteStr = WriteStr;
209+ pv->DumpByte = DumpByte;
210+ pv->DumpFlush = DumpFlush;
211+ pv->WriteRaw = WriteRawData;
212+ pv->Destory = ProtoLogDestroy;
213+
214+ pdata->LogFile = INVALID_HANDLE_VALUE;
215+
216+ return pv;
217+}
--- trunk/teraterm/ttpfile/protolog.h (nonexistent)
+++ trunk/teraterm/ttpfile/protolog.h (revision 9467)
@@ -0,0 +1,63 @@
1+/*
2+ * (C) 2021- TeraTerm Project
3+ * All rights reserved.
4+ *
5+ * Redistribution and use in source and binary forms, with or without
6+ * modification, are permitted provided that the following conditions
7+ * are met:
8+ *
9+ * 1. Redistributions of source code must retain the above copyright
10+ * notice, this list of conditions and the following disclaimer.
11+ * 2. Redistributions in binary form must reproduce the above copyright
12+ * notice, this list of conditions and the following disclaimer in the
13+ * documentation and/or other materials provided with the distribution.
14+ * 3. The name of the author may not be used to endorse or promote products
15+ * derived from this software without specific prior written permission.
16+ *
17+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
18+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20+ * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+ */
28+
29+#pragma once
30+
31+#include <stdlib.h> // for size_t
32+#include <windows.h> // for BOOL
33+
34+#ifdef __cplusplus
35+extern "C" {
36+#endif
37+
38+typedef struct ProtoLog {
39+ // public
40+ BOOL (*Open)(struct ProtoLog *pv, const char *file);
41+ BOOL (*OpenA)(struct ProtoLog *pv, const char *file);
42+ BOOL (*OpenW)(struct ProtoLog *pv, const wchar_t *file);
43+ BOOL (*OpenU8)(struct ProtoLog *pv, const char *fileU8);
44+ void (*Close)(struct ProtoLog *pv);
45+ /**
46+ * フォルダをセットする
47+ * @param[in] フォルダ(NULLのときフォルダ未設定となる)
48+ */
49+ void (*SetFolderW)(struct ProtoLog *pv, const wchar_t *folder);
50+ size_t (*WriteRaw)(struct ProtoLog *pv, const void *data, size_t len);
51+ size_t (*WriteStr)(struct ProtoLog *pv, const char *str);
52+ void (*DumpByte)(struct ProtoLog *pv, BYTE b);
53+ void (*DumpFlush)(struct ProtoLog *pv);
54+ void (*Destory)(struct ProtoLog *pv);
55+ // private
56+ void *private_data;
57+} TProtoLog;
58+
59+TProtoLog *ProtoLogCreate(void);
60+
61+#ifdef __cplusplus
62+}
63+#endif
--- trunk/teraterm/ttpfile/quickvan.c (revision 9466)
+++ trunk/teraterm/ttpfile/quickvan.c (revision 9467)
@@ -62,6 +62,7 @@
6262 BYTE CheckSum;
6363 TProtoLog *log;
6464 const char *FullName; // Windows上のファイル名 UTF-8
65+ WORD LogState;
6566 } TQVVar;
6667 typedef TQVVar far *PQVVar;
6768
@@ -109,9 +110,9 @@
109110
110111 if (qv->log != NULL) {
111112 TProtoLog *log = qv->log;
112- if (log->LogState!=1)
113+ if (qv->LogState!=1)
113114 {
114- log->LogState = 1;
115+ qv->LogState = 1;
115116 log->WriteRaw(log, "\015\012<<<\015\012", 7);
116117 }
117118 log->DumpByte(log, *b);
@@ -127,8 +128,8 @@
127128
128129 if (qv->log != NULL && (i>0)) {
129130 TProtoLog* log = qv->log;
130- if (log->LogState != 0) {
131- log->LogState = 0;
131+ if (qv->LogState != 0) {
132+ qv->LogState = 0;
132133 log->WriteRaw(log, "\015\012>>>\015\012", 7);
133134 }
134135 for (j=0 ; j <= i-1 ; j++)
@@ -165,8 +166,9 @@
165166 if ((ts->LogFlag & LOG_QV)!=0) {
166167 TProtoLog* log = ProtoLogCreate();
167168 qv->log = log;
169+ log->SetFolderW(log, ts->LogDirW);
168170 log->Open(log, "QUICKVAN.LOG");
169- log->LogState = 2;
171+ qv->LogState = 2;
170172 }
171173
172174 fv->FileOpen = FALSE;
--- trunk/teraterm/ttpfile/xmodem.c (revision 9466)
+++ trunk/teraterm/ttpfile/xmodem.c (revision 9467)
@@ -58,6 +58,7 @@
5858 int CANCount;
5959 TProtoLog *log;
6060 const char *FullName; // Windows上のファイル名 UTF-8
61+ WORD LogState;
6162 } TXVar;
6263 typedef TXVar far *PXVar;
6364
@@ -85,11 +86,11 @@
8586 if (xv->log != NULL) {
8687 TProtoLog *log = xv->log;
8788
88- if (log->LogState == 0) {
89+ if (xv->LogState == 0) {
8990 // 残りのASCII表示を行う
9091 log->DumpFlush(log);
9192
92- log->LogState = 1;
93+ xv->LogState = 1;
9394 log->WriteRaw(log, "\015\012<<<\015\012", 7);
9495 }
9596 log->DumpByte(log, *b);
@@ -104,11 +105,11 @@
104105 i = CommBinaryOut(cv, B, C);
105106 if (xv->log != NULL && (i > 0)) {
106107 TProtoLog* log = xv->log;
107- if (log->LogState != 0) {
108+ if (xv->LogState != 0) {
108109 // 残りのASCII表示を行う
109110 log->DumpFlush(log);
110111
111- log->LogState = 0;
112+ xv->LogState = 0;
112113 log->WriteRaw(log, "\015\012>>>\015\012", 7);
113114 }
114115 for (j = 0; j <= i - 1; j++)
@@ -224,8 +225,9 @@
224225 if (LogFlag) {
225226 TProtoLog* log = ProtoLogCreate();
226227 xv->log = log;
228+ log->SetFolderW(log, ts->LogDirW);
227229 log->Open(log, "XMODEM.LOG");
228- log->LogState = 0;
230+ xv->LogState = 0;
229231 }
230232
231233 xv->FullName = fv->GetNextFname(fv);
--- trunk/teraterm/ttpfile/ymodem.c (revision 9466)
+++ trunk/teraterm/ttpfile/ymodem.c (revision 9467)
@@ -69,6 +69,7 @@
6969 BOOL RecvFilesize;
7070 TProtoLog *log;
7171 const char *FullName; // Windows上のファイル名 UTF-8
72+ WORD LogState;
7273 } TYVar;
7374 typedef TYVar *PYVar;
7475
@@ -106,12 +107,12 @@
106107 if (yv->log != NULL)
107108 {
108109 TProtoLog *log = yv->log;
109- if (log->LogState==0)
110+ if (yv->LogState==0)
110111 {
111112 // 残りのASCII表示を行う
112113 log->DumpFlush(log);
113114
114- log->LogState = 1;
115+ yv->LogState = 1;
115116 log->WriteRaw(log, "\015\012<<<\015\012", 7);
116117 }
117118 log->DumpByte(log, *b);
@@ -127,12 +128,12 @@
127128 if (yv->log != NULL && (i>0))
128129 {
129130 TProtoLog* log = yv->log;
130- if (log->LogState != 0)
131+ if (yv->LogState != 0)
131132 {
132133 // 残りのASCII表示を行う
133134 log->DumpFlush(log);
134135
135- log->LogState = 0;
136+ yv->LogState = 0;
136137 log->WriteRaw(log, "\015\012>>>\015\012", 7);
137138 }
138139 for (j=0 ; j <= i-1 ; j++)
@@ -346,8 +347,9 @@
346347 if ((ts->LogFlag & LOG_Y)!=0) {
347348 TProtoLog* log = ProtoLogCreate();
348349 yv->log = log;
350+ log->SetFolderW(log, ts->LogDirW);
349351 log->Open(log, "YMODEM.LOG");
350- log->LogState = 0;
352+ yv->LogState = 0;
351353 }
352354
353355 initialize_file_info(fv, yv);
--- trunk/teraterm/ttpfile/zmodem.c (revision 9466)
+++ trunk/teraterm/ttpfile/zmodem.c (revision 9467)
@@ -80,6 +80,7 @@
8080 int TOutFin;
8181 TProtoLog *log;
8282 const char *FullName; // Windows上のファイル名 UTF-8
83+ WORD LogState;
8384 } TZVar;
8485 typedef TZVar far *PZVar;
8586
@@ -256,13 +257,13 @@
256257
257258 if (zv->log != NULL) {
258259 TProtoLog *log = zv->log;
259- if (log->LogState == 0) {
260+ if (zv->LogState == 0) {
260261 // 残りのASCII表示を行う
261262 log->DumpFlush(log);
262263
263264 show_sendbuf(log);
264265
265- log->LogState = 1;
266+ zv->LogState = 1;
266267 s = "\015\012<<< Received\015\012";
267268 log->WriteRaw(log, s, strlen(s));
268269 }
@@ -283,13 +284,13 @@
283284
284285 if (zv->log != NULL && (i > 0)) {
285286 TProtoLog* log = zv->log;
286- if (log->LogState != 0) {
287+ if (zv->LogState != 0) {
287288 // 残りのASCII表示を行う
288289 log->DumpFlush(log);
289290
290291 show_recvbuf(log);
291292
292- log->LogState = 0;
293+ zv->LogState = 0;
293294 s = "\015\012Sending >>>\015\012";
294295 log->WriteRaw(log, s, strlen(s));
295296 }
@@ -767,8 +768,9 @@
767768 if ((ts->LogFlag & LOG_Z) != 0) {
768769 TProtoLog* log = ProtoLogCreate();
769770 zv->log = log;
771+ log->SetFolderW(log, ts->LogDirW);
770772 log->Open(log, "ZMODEM.LOG");
771- log->LogState = 0;
773+ zv->LogState = 0;
772774 }
773775
774776 switch (zv->ZMode) {
旧リポジトリブラウザで表示