mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-27 07:44:24 +02:00
Fix invalid dot-char(s) handling in filenames checking
Remove the restriction of file extesion on reserved name in Windows system. Fix #16328, close #16331
This commit is contained in:
parent
15b92c69d7
commit
bb61d0fabc
@ -1530,15 +1530,14 @@ bool isUnsupportedFileName(const wstring& fileName)
|
||||
|
||||
if (!invalidASCIIChar)
|
||||
{
|
||||
// strip input string to a filename without a possible path and extension(s)
|
||||
// strip input string to a filename without a possible path and/or ending dot-char
|
||||
wstring fileNameOnly;
|
||||
size_t pos = fileName.find_first_of(L".");
|
||||
if (pos != std::string::npos)
|
||||
fileNameOnly = fileName.substr(0, pos);
|
||||
if (fileName.ends_with(L'.'))
|
||||
fileNameOnly = fileName.substr(0, fileName.rfind(L"."));
|
||||
else
|
||||
fileNameOnly = fileName;
|
||||
|
||||
pos = fileNameOnly.find_last_of(L"\\");
|
||||
size_t pos = fileNameOnly.find_last_of(L"\\");
|
||||
if (pos == std::string::npos)
|
||||
pos = fileNameOnly.find_last_of(L"/");
|
||||
if (pos != std::string::npos)
|
||||
|
Loading…
x
Reference in New Issue
Block a user