Merge pull request #2161 from RaiKoHoff/NewFeatures

Fix small bug in UnslashQuotes
This commit is contained in:
Rainer Kottenhoff 2020-03-26 00:26:57 +01:00 committed by GitHub
commit 62b1cd0a31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 18 additions and 20 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
325
326

View File

@ -3,7 +3,7 @@
<assemblyIdentity
name="Notepad3"
processorArchitecture="*"
version="5.20.325.1"
version="5.20.326.1"
type="win32"
/>
<description>Notepad3 NF</description>

View File

@ -6625,12 +6625,13 @@ bool EditFindNext(HWND hwnd, LPCEDITFINDREPLACE lpefr, bool bExtendSelection, bo
if (!bSuppressNotFound) {
InfoBoxLng(MB_OK, L"MsgNotFound", IDS_MUI_NOTFOUND);
}
//@@@
#ifdef _DEBUG
WCHAR fnd[256];
WCHAR msg[256];
MultiByteToWideChar(CP_UTF8, 0, szFind, -1, fnd, (int)COUNTOF(fnd));
StringCchPrintf(msg, COUNTOF(msg), L"Suchbegriff:'%s'", fnd);
MsgBoxLastError(msg, 0);
#endif
return false;
}

View File

@ -1257,7 +1257,7 @@ bool ExtractFirstArgument(LPCWSTR lpArgs, LPWSTR lpArg1, LPWSTR lpArg2, int len)
}
}
TrimSpcW(lpArg1);
UnSlashQuotes(lpArg1);
UnSlashChar(lpArg1, L'"');
if (lpArg2) {
TrimSpcW(lpArg2);
@ -1945,32 +1945,29 @@ size_t UnSlashW(LPWSTR pchInOut)
}
size_t UnSlashQuotes(LPWSTR pchInOut)
size_t UnSlashChar(LPWSTR pchInOut, WCHAR wch)
{
LPWSTR s = pchInOut;
LPWSTR o = pchInOut;
LPCWSTR const sStart = pchInOut;
LPWSTR s = pchInOut;
LPWSTR o = pchInOut;
while (*s) {
if (*s == '\\') {
if (*s == L'\\') {
++s;
if (*s == L'"')
*o = L'"';
else if (*s == L'\\')
*o = L'\\';
if (*s == wch)
*o++ = wch;
else {
*o = *s; // swallow single '\'
*o++ = L'\\'; // restore
*o++ = *s;
}
}
else
*o = *s;
++o;
*o++ = *s;
if (*s) {
++s;
}
}
*o = '\0';
*o = L'\0';
return (size_t)((ptrdiff_t)(o - sStart));
}

View File

@ -323,7 +323,7 @@ size_t SlashW(LPWSTR pchOutput, size_t cchOutLen, LPCWSTR pchInput);
size_t UnSlashA(LPSTR pchInOut, UINT cpEdit);
size_t UnSlashW(LPWSTR pchInOut);
size_t UnSlashQuotes(LPWSTR pchInOut);
size_t UnSlashChar(LPWSTR pchInOut, WCHAR wch);
void TransformBackslashes(char* pszInput, bool, UINT cpEdit, int* iReplaceMsg);
void TransformMetaChars(char* pszInput, bool, int iEOLMode);

View File

@ -8,7 +8,7 @@
#define SAPPNAME "Notepad3"
#define VERSION_MAJOR 5
#define VERSION_MINOR 20
#define VERSION_REV 325
#define VERSION_REV 326
#define VERSION_BUILD 1
#define SCINTILLA_VER 432
#define ONIGURUMA_REGEX_VER 6.9.4
@ -16,4 +16,4 @@
#define TINYEXPR_VER 2018.05.11
#define UTHASH_VER 2.1.0
#define VERSION_PATCH NF
#define VERSION_COMMIT_ID t7820-rk
#define VERSION_COMMIT_ID nebukadn