Skip to content

Commit

Permalink
Merge branch 'stefan/powerrename_wip' of github.com:microsoft/PowerTo…
Browse files Browse the repository at this point in the history
…ys into stefan/powerrename_wip
  • Loading branch information
stefansjfw committed Aug 17, 2022
2 parents 1942532 + 6276b6c commit 8202233
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/powerrename/lib/PowerRenameManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ DWORD WINAPI CPowerRenameManager::s_regexWorkerThread(_In_ void* pv)
spItem->GetPath(&path);

// Following characters cannot be used for file names.
// Ref https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions
// Ref https://docs.microsoft.com/windows/win32/fileio/naming-a-file#naming-conventions
if (newNameToUseWstr.contains('<') ||
newNameToUseWstr.contains('>') ||
newNameToUseWstr.contains(':') ||
Expand All @@ -1136,8 +1136,8 @@ DWORD WINAPI CPowerRenameManager::s_regexWorkerThread(_In_ void* pv)
{
spItem->PutStatus(PowerRenameItemRenameStatus::ItemNameInvalidChar);
}
// Max file path is 260.
// Ref https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
// Max file path is 260 and max folder path is 247.
// Ref https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
else if ((isFolder && lstrlen(path) + (lstrlen(newNameToUse) - lstrlen(originalName)) > 247) ||
lstrlen(path) + (lstrlen(newNameToUse) - lstrlen(originalName)) > 260)
{
Expand Down

0 comments on commit 8202233

Please sign in to comment.