From afb3889ffbfecbcf943bbceda06e5f74fdddaaf3 Mon Sep 17 00:00:00 2001 From: Don HO Date: Thu, 27 Jul 2017 12:44:06 +0200 Subject: [PATCH] Fix a regression regarding b85930314847727ee8070d1417e674afd1bb24ab --- PowerEditor/src/Notepad_plus.cpp | 3 ++- PowerEditor/src/winmain.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index f8bddff90..bc6eac5d9 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -5248,7 +5248,8 @@ void Notepad_plus::notifyBufferActivated(BufferID bufid, int view) _linkTriggered = true; } -void Notepad_plus::loadCommandlineParams(const TCHAR * commandLine, CmdLineParams * pCmdParams) { +void Notepad_plus::loadCommandlineParams(const TCHAR * commandLine, CmdLineParams * pCmdParams) +{ if (!commandLine || ! pCmdParams) return; diff --git a/PowerEditor/src/winmain.cpp b/PowerEditor/src/winmain.cpp index aa6532cc8..84c8b7ebc 100644 --- a/PowerEditor/src/winmain.cpp +++ b/PowerEditor/src/winmain.cpp @@ -30,7 +30,7 @@ #include "Win32Exception.h" //Win32 exception #include "MiniDumper.h" //Write dump files -typedef std::vector ParamVector; +typedef std::vector ParamVector; namespace @@ -190,7 +190,7 @@ bool isInList(const TCHAR *token2Find, ParamVector & params) for (size_t i = 0; i < nbItems; ++i) { - if (!lstrcmp(token2Find, params.at(i))) + if (!lstrcmp(token2Find, params.at(i).c_str())) { params.erase(params.begin() + i); return true; @@ -206,7 +206,7 @@ bool getParamVal(TCHAR c, ParamVector & params, generic_string & value) for (size_t i = 0; i < nbItems; ++i) { - const TCHAR * token = params.at(i); + const TCHAR * token = params.at(i).c_str(); if (token[0] == '-' && lstrlen(token) >= 2 && token[1] == c) { //dash, and enough chars value = (token+2); params.erase(params.begin() + i); @@ -223,7 +223,7 @@ bool getParamValFromString(const TCHAR *str, ParamVector & params, generic_strin for (size_t i = 0; i < nbItems; ++i) { - const TCHAR * token = params.at(i); + const TCHAR * token = params.at(i).c_str(); generic_string tokenStr = token; size_t pos = tokenStr.find(str); if (pos != generic_string::npos && pos == 0) @@ -409,7 +409,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int) for (size_t i = 0; i < nbFilesToOpen; ++i) { - const TCHAR * currentFile = params.at(i); + const TCHAR * currentFile = params.at(i).c_str(); if (currentFile[0]) { //check if relative or full path. Relative paths dont have a colon for driveletter