[BUG_FIXED] Fix the crash by using wide card to open files on cmdline.

By using string instead of char * in the constructor std::string::string() make a call:
string (const string& str, size_t pos, size_t len = npos);
instead of:
string (const char* s, size_t n);
This commit is contained in:
Don HO 2015-08-25 14:39:11 +02:00
parent 091082c31c
commit dc4897c8f2

View File

@ -262,7 +262,11 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive,
size_t pos = substring - fileName.c_str();
patterns.push_back(substring + 1);
generic_string dir(fileName, pos + 1);
generic_string dir(fileName.c_str(), pos + 1); // use char * to evoke:
// string (const char* s, size_t n);
// and avoid to call (if pass string) :
// string (const string& str, size_t pos, size_t len = npos);
getMatchedFileNames(dir.c_str(), patterns, fileNames, isRecursive, false);
}
else