From d8f278c84e0c90de2f74904ac43d9caf66eb85aa Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Fri, 13 Mar 2020 20:42:46 +0100 Subject: [PATCH] + fix: locked ini-file handling: create empty file if not exist for writing (style export) --- Versions/build.txt | 2 +- minipath/src/Config.cpp | 2 +- res/Notepad3.exe.manifest.conf | 2 +- src/Config/Config.cpp | 2 +- src/VersionEx.h | 2 +- test/test_files/others/Complex-script-samples (issue #2019).txt | 1 + 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Versions/build.txt b/Versions/build.txt index 0cfbf0888..00750edc0 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -2 +3 diff --git a/minipath/src/Config.cpp b/minipath/src/Config.cpp index 1de6a8c89..0ed2e513b 100644 --- a/minipath/src/Config.cpp +++ b/minipath/src/Config.cpp @@ -79,7 +79,7 @@ HANDLE AcquireWriteFileLock(LPCWSTR lpIniFilePath, OVERLAPPED& rOvrLpd) { HANDLE hFile = CreateFile(lpIniFilePath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, - nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); + nullptr, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); DWORD const flags = LOCKFILE_EXCLUSIVE_LOCK; bool const bLocked = LockFileEx(hFile, flags, 0, MAXDWORD, 0, &rOvrLpd); diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index 2d98feed8..12ee03daf 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 RC3 diff --git a/src/Config/Config.cpp b/src/Config/Config.cpp index f006280c4..571da5f63 100644 --- a/src/Config/Config.cpp +++ b/src/Config/Config.cpp @@ -93,7 +93,7 @@ HANDLE AcquireWriteFileLock(LPCWSTR lpIniFilePath, OVERLAPPED& rOvrLpd) { HANDLE hFile = CreateFile(lpIniFilePath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, - nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); + nullptr, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); DWORD const flags = LOCKFILE_EXCLUSIVE_LOCK; bool const bLocked = LockFileEx(hFile, flags, 0, MAXDWORD, 0, &rOvrLpd); diff --git a/src/VersionEx.h b/src/VersionEx.h index 4141a7398..025a0b310 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -9,7 +9,7 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 20 #define VERSION_REV 313 -#define VERSION_BUILD 2 +#define VERSION_BUILD 3 #define SCINTILLA_VER 432 #define ONIGURUMA_REGEX_VER 6.9.4 #define UCHARDET_VER 2018.09.27 diff --git a/test/test_files/others/Complex-script-samples (issue #2019).txt b/test/test_files/others/Complex-script-samples (issue #2019).txt index 78f03c405..3b345649f 100644 --- a/test/test_files/others/Complex-script-samples (issue #2019).txt +++ b/test/test_files/others/Complex-script-samples (issue #2019).txt @@ -9,6 +9,7 @@ Bengali, LTR: Devanagari, LTR: मैं काँच खा सकता हूँ और मुझे उससे कोई चोट नहीं पहुंचती +संस्कृत Tamil, LTR: நான் கண்ணாடி சாப்பிடுவேன், அதனால் எனக்கு ஒரு கேடும் வராது.