From e1c2ea5c83bf5747992b8c21304c28df18621deb Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Sat, 28 Mar 2020 09:33:44 +0100 Subject: [PATCH] + fix: Logical Number comparison --- Versions/build.txt | 2 +- res/Notepad3.exe.manifest.conf | 2 +- src/Edit.c | 5 +++-- src/VersionEx.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Versions/build.txt b/Versions/build.txt index d00491fd7..0cfbf0888 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -1 +2 diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index 22830e86b..9fb8b3db1 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 RC3 diff --git a/src/Edit.c b/src/Edit.c index f426f55a8..574833c80 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -4676,7 +4676,8 @@ static int _wcsicoll_s(const wchar_t* s1, const wchar_t* s2) { return wcsicoll_s // ---------------------------------------------------------------------------- int CmpStdLogical(const void *s1, const void *s2) { - if (s1 && s2) { + if (StrIsNotEmpty(s1) && StrIsNotEmpty(s2)) + { int cmp = StrCmpLogicalW(((SORTLINE*)s1)->pwszSortEntry, ((SORTLINE*)s2)->pwszSortEntry); if (cmp == 0) { cmp = StrCmpLogicalW(((SORTLINE*)s1)->pwszLine, ((SORTLINE*)s2)->pwszLine); @@ -4684,7 +4685,7 @@ int CmpStdLogical(const void *s1, const void *s2) { return (cmp) ? cmp : CmpStd(s1, s2); } else { - return (s1 ? 1 : (s2 ? -1 : 0)); + return (StrIsNotEmpty(s1) ? 1 : (StrIsNotEmpty(s2) ? -1 : 0)); } } diff --git a/src/VersionEx.h b/src/VersionEx.h index d91a9f9fd..6c07bcba7 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -9,7 +9,7 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 20 #define VERSION_REV 328 -#define VERSION_BUILD 1 +#define VERSION_BUILD 2 #define SCINTILLA_VER 432 #define ONIGURUMA_REGEX_VER 6.9.4 #define UCHARDET_VER 2018.09.27