Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/teraterm/teraterm/filesys_log.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 9870 by zmatsuo, Wed Apr 20 13:01:51 2022 UTC revision 9871 by zmatsuo, Wed Apr 20 13:02:00 2022 UTC
# Line 725  static BOOL LogStart(const wchar_t *fnam Line 725  static BOOL LogStart(const wchar_t *fnam
725          cv_LCount = 0;          cv_LCount = 0;
726    
727          OpenLogFile(fv);          OpenLogFile(fv);
728          if (LogVar->FileHandle == INVALID_HANDLE_VALUE) {          if (fv->FileHandle == INVALID_HANDLE_VALUE) {
729                  return FALSE;                  return FALSE;
730          }          }
731    
# Line 733  static BOOL LogStart(const wchar_t *fnam Line 733  static BOOL LogStart(const wchar_t *fnam
733          fv->eLineEnd = Line_LineHead;          fv->eLineEnd = Line_LineHead;
734          if (ts.Append > 0)          if (ts.Append > 0)
735          {          {
736                  SetFilePointer(LogVar->FileHandle, 0, NULL, FILE_END);                  SetFilePointer(fv->FileHandle, 0, NULL, FILE_END);
737                  /* 2007.05.24 Gentaro                  /* 2007.05.24 Gentaro
738                     If log file already exists,                     If log file already exists,
739                     a newline is inserted before the first timestamp.                     a newline is inserted before the first timestamp.
# Line 748  static BOOL LogStart(const wchar_t *fnam Line 748  static BOOL LogStart(const wchar_t *fnam
748          }          }
749    
750          // Log rotate configuration          // Log rotate configuration
751          LogVar->RotateMode = ts.LogRotate;          fv->RotateMode = ts.LogRotate;
752          LogVar->RotateSize = ts.LogRotateSize;          fv->RotateSize = ts.LogRotateSize;
753          LogVar->RotateStep = ts.LogRotateStep;          fv->RotateStep = ts.LogRotateStep;
754    
755          // Log rotateが有効の場合、初期ファイルサイズを設定する。          // Log rotateが有効の場合、初期ファイルサイズを設定する。
756          // 最初のファイルが設定したサイズでローテートしない問題の修正。          // 最初のファイルが設定したサイズでローテートしない問題の修正。
757          // (2016.4.9 yutaka)          // (2016.4.9 yutaka)
758          if (LogVar->RotateMode != ROTATE_NONE) {          if (fv->RotateMode != ROTATE_NONE) {
759                  DWORD size = GetFileSize(LogVar->FileHandle, NULL);                  DWORD size = GetFileSize(fv->FileHandle, NULL);
760                  if (size == -1) {                  if (size == -1) {
761                          return FALSE;                          return FALSE;
762                  }                  }
763                  LogVar->ByteCount = size;                  fv->ByteCount = size;
764          }          }
765          else {          else {
766                  LogVar->ByteCount = 0;                  fv->ByteCount = 0;
767          }          }
768    
769          if (! OpenFTDlg_(LogVar)) {          if (! OpenFTDlg_(fv)) {
770                  return FALSE;                  return FALSE;
771          }          }
772    
773          LogVar->IsPause = FALSE;          fv->IsPause = FALSE;
774          LogVar->StartTime = GetTickCount();          fv->StartTime = GetTickCount();
775    
776          if (ts.DeferredLogWriteMode) {          if (ts.DeferredLogWriteMode) {
777                  StartThread(LogVar);                  StartThread(fv);
778          }          }
779    
780          if (FileLog) {          if (FileLog) {
# Line 1557  static void FLogOutputBOM(void) Line 1557  static void FLogOutputBOM(void)
1557          case 0: {          case 0: {
1558                  // UTF-8                  // UTF-8
1559                  const char *bom = "\xef\xbb\xbf";                  const char *bom = "\xef\xbb\xbf";
1560                  WriteFile(LogVar->FileHandle, bom, 3, &wrote, NULL);                  WriteFile(fv->FileHandle, bom, 3, &wrote, NULL);
1561                  LogVar->ByteCount += 3;                  fv->ByteCount += 3;
1562                  break;                  break;
1563          }          }
1564          case 1: {          case 1: {
1565                  // UTF-16LE                  // UTF-16LE
1566                  const char *bom = "\xff\xfe";                  const char *bom = "\xff\xfe";
1567                  WriteFile(LogVar->FileHandle, bom, 2, &wrote, NULL);                  WriteFile(fv->FileHandle, bom, 2, &wrote, NULL);
1568                  LogVar->ByteCount += 2;                  fv->ByteCount += 2;
1569                  break;                  break;
1570          }          }
1571          case 2: {          case 2: {
1572                  // UTF-16BE                  // UTF-16BE
1573                  const char *bom = "\xfe\xff";                  const char *bom = "\xfe\xff";
1574                  WriteFile(LogVar->FileHandle, bom, 2, &wrote, NULL);                  WriteFile(fv->FileHandle, bom, 2, &wrote, NULL);
1575                  LogVar->ByteCount += 2;                  fv->ByteCount += 2;
1576                  break;                  break;
1577          }          }
1578          default:          default:

Legend:
Removed from v.9870  
changed lines
  Added in v.9871

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26