From 84c7535c191584661a477eb13d0fea62cbe935cb Mon Sep 17 00:00:00 2001 From: RaiKoHoff Date: Mon, 2 Mar 2020 16:20:13 +0100 Subject: [PATCH 1/4] + fix: Oniguruma update (2020-03-02b) --- oniguruma/src/regexec.c | 13 ++++++++++++- oniguruma/version.txt | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/oniguruma/src/regexec.c b/oniguruma/src/regexec.c index f98bcbe38..79ffce122 100644 --- a/oniguruma/src/regexec.c +++ b/oniguruma/src/regexec.c @@ -4641,7 +4641,18 @@ onig_regset_search_with_param(OnigRegSet* set, for (i = 0; i < set->n; i++) { reg = set->rs[i].reg; if (reg->threshold_len == 0) { - REGSET_MATCH_AND_RETURN_CHECK(end); + /* REGSET_MATCH_AND_RETURN_CHECK(end); */ + /* Can't use REGSET_MATCH_AND_RETURN_CHECK() + because r must be set regex index (i) + */ + r = match_at(reg, str, end, end, s, prev, msas + i); + if (r != ONIG_MISMATCH) { + if (r >= 0) { + r = i; + goto match; + } + else goto finish; /* error */ + } } } diff --git a/oniguruma/version.txt b/oniguruma/version.txt index e1e5d1369..c250d84b8 100644 --- a/oniguruma/version.txt +++ b/oniguruma/version.txt @@ -1 +1 @@ -6.9.5 +6.9.4 From 59490f223e4a6cb0915cd9d7ad9faf0415a930f8 Mon Sep 17 00:00:00 2001 From: RaiKoHoff Date: Mon, 2 Mar 2020 17:03:44 +0100 Subject: [PATCH 2/4] + fix: "[~EOF~] for .ini - files + fix: Styles export if file does not exist --- Versions/build.txt | 2 +- res/Notepad3.exe.manifest.conf | 2 +- src/Config/Config.cpp | 2 ++ src/Styles.c | 9 ++++----- src/VersionEx.h | 6 +++--- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Versions/build.txt b/Versions/build.txt index 7ed6ff82d..1e8b31496 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -5 +6 diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index 8bff3b0db..4a376891c 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 RC2 diff --git a/src/Config/Config.cpp b/src/Config/Config.cpp index 29df8238d..56ffd6a2b 100644 --- a/src/Config/Config.cpp +++ b/src/Config/Config.cpp @@ -1664,6 +1664,8 @@ bool SaveAllSettings(bool bForceSaveSettings) } } + IniSectionClear(L"~EOF~", false); + if (ok) { ok = CloseSettingsFile(true); } diff --git a/src/Styles.c b/src/Styles.c index 210d6abf9..1d463f0a9 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -825,11 +825,10 @@ bool Style_ExportToFile(const WCHAR* szFile, bool bForceAll) } } else { - // reset - if (LoadIniFile(szFilePathNorm)) { - Style_ToIniSection(bForceAll); - ok = SaveIniFile(szFilePathNorm); - } + LoadIniFile(szFilePathNorm); // reset + Style_ToIniSection(bForceAll); + IniSectionClear(L"~EOF~", false); + ok = SaveIniFile(szFilePathNorm); } return ok; } diff --git a/src/VersionEx.h b/src/VersionEx.h index cacf98993..77b91edee 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -9,11 +9,11 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 20 #define VERSION_REV 302 -#define VERSION_BUILD 5 +#define VERSION_BUILD 6 #define SCINTILLA_VER 431 -#define ONIGURUMA_REGEX_VER 6.9.5 +#define ONIGURUMA_REGEX_VER 6.9.4 #define UCHARDET_VER 2018.09.27 #define TINYEXPR_VER 2018.05.11 #define UTHASH_VER 2.1.0 #define VERSION_PATCH RC2 -#define VERSION_COMMIT_ID dkt1-amr +#define VERSION_COMMIT_ID t7820-rk From b39e33143750fcef232cf4e54f66bf8873c1f18a Mon Sep 17 00:00:00 2001 From: RaiKoHoff Date: Mon, 2 Mar 2020 17:19:59 +0100 Subject: [PATCH 3/4] + fix: remove "~EOF~" section marker for .ini-files --- src/Config/Config.cpp | 2 -- src/Styles.c | 1 - 2 files changed, 3 deletions(-) diff --git a/src/Config/Config.cpp b/src/Config/Config.cpp index 56ffd6a2b..29df8238d 100644 --- a/src/Config/Config.cpp +++ b/src/Config/Config.cpp @@ -1664,8 +1664,6 @@ bool SaveAllSettings(bool bForceSaveSettings) } } - IniSectionClear(L"~EOF~", false); - if (ok) { ok = CloseSettingsFile(true); } diff --git a/src/Styles.c b/src/Styles.c index 1d463f0a9..e01416357 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -827,7 +827,6 @@ bool Style_ExportToFile(const WCHAR* szFile, bool bForceAll) else { LoadIniFile(szFilePathNorm); // reset Style_ToIniSection(bForceAll); - IniSectionClear(L"~EOF~", false); ok = SaveIniFile(szFilePathNorm); } return ok; From 39803839071b7dea41c1e368892d7c4faa1328bc Mon Sep 17 00:00:00 2001 From: RaiKoHoff Date: Mon, 2 Mar 2020 18:20:33 +0100 Subject: [PATCH 4/4] + fix: debug assertion (isspace() called on non ASCII char) --- sciXlexers/LexAHKL.cxx | 10 +++++----- scintilla/lexers/LexSQL.cxx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sciXlexers/LexAHKL.cxx b/sciXlexers/LexAHKL.cxx index 119b6f492..9a0057706 100644 --- a/sciXlexers/LexAHKL.cxx +++ b/sciXlexers/LexAHKL.cxx @@ -250,7 +250,7 @@ void SCI_METHOD LexerAHKL::Lex(Sci_PositionU startPos, Sci_Position lengthDoc, i } // Comments are allowed almost everywhere - if (!inStringBlk && !inCommentBlk && (OnlySpaces || isspace(sc.chPrev)) && sc.ch == ';') + if (!inStringBlk && !inCommentBlk && (OnlySpaces || isspacechar(sc.chPrev)) && sc.ch == ';') sc.SetState(SCE_AHKL_COMMENTLINE); // Exit Current State @@ -412,7 +412,7 @@ void SCI_METHOD LexerAHKL::Lex(Sci_PositionU startPos, Sci_Position lengthDoc, i sc.Forward(2); sc.SetState(SCE_AHKL_NEUTRAL); - } else if ((OnlySpaces || isspace(sc.chPrev)) && + } else if ((OnlySpaces || isspacechar(sc.chPrev)) && ((sc.ch == '@' && isalnum(sc.chNext & 0xFF)) || valDocComment.Contains(sc.ch))) { if (valDocComment.Contains(sc.ch)) @@ -443,7 +443,7 @@ void SCI_METHOD LexerAHKL::Lex(Sci_PositionU startPos, Sci_Position lengthDoc, i } case SCE_AHKL_HEXNUMBER: { - if (isspace(sc.ch) || SynOperator.Contains(sc.ch)) + if (isspacechar(sc.ch) || SynOperator.Contains(sc.ch)) sc.SetState(SCE_AHKL_NEUTRAL); else if (!isxdigit(sc.ch & 0xFF)) @@ -610,8 +610,8 @@ void SCI_METHOD LexerAHKL::Lex(Sci_PositionU startPos, Sci_Position lengthDoc, i // Handle Expressions if ((OnlySpaces && sc.ch == '.') || sc.Match(" % ") || (sc.ch == '(') - || ((valIdentifier.Contains(sc.chPrev) || isspace(sc.chPrev)) && sc.ch == '?') - || ((valIdentifier.Contains(sc.chPrev) || isspace(sc.chPrev)) && ExpOperator.Contains(sc.ch) && sc.chNext == '=') + || ((valIdentifier.Contains(sc.chPrev) || isspacechar(sc.chPrev)) && sc.ch == '?') + || ((valIdentifier.Contains(sc.chPrev) || isspacechar(sc.chPrev)) && ExpOperator.Contains(sc.ch) && sc.chNext == '=') || (valIdentifier.Contains(sc.chPrev) && sc.ch == '[')) { expLevel += 1; diff --git a/scintilla/lexers/LexSQL.cxx b/scintilla/lexers/LexSQL.cxx index c7f913d25..c9f79f6ac 100644 --- a/scintilla/lexers/LexSQL.cxx +++ b/scintilla/lexers/LexSQL.cxx @@ -530,7 +530,7 @@ void SCI_METHOD LexerSQL::Lex(Sci_PositionU startPos, Sci_Position length, int i } else if (!IsADoxygenChar(sc.ch)) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); - if (!isspace(sc.ch) || !kw_pldoc.InList(s + 1)) { + if (!isspacechar(sc.ch) || !kw_pldoc.InList(s + 1)) { sc.ChangeState(SCE_SQL_COMMENTDOCKEYWORDERROR); } sc.SetState(styleBeforeDCKeyword);