diff options
| author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2025-07-05 00:00:00 +0000 |
|---|---|---|
| committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2025-07-05 19:27:33 +0500 |
| commit | 395149956d696e6e3099d8b76d797437f94a6942 (patch) | |
| tree | 6ed5013a637078ae2dfdc4acf1ad93bf29cea356 /CPP/Common/Wildcard.cpp | |
| parent | e5431fa6f5505e385c6f9367260717e9c47dc2ee (diff) | |
| download | 7zip-25.00.tar.gz 7zip-25.00.tar.bz2 7zip-25.00.zip | |
25.0025.00
Diffstat (limited to 'CPP/Common/Wildcard.cpp')
| -rw-r--r-- | CPP/Common/Wildcard.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/CPP/Common/Wildcard.cpp b/CPP/Common/Wildcard.cpp index 798cbd9..b561a89 100644 --- a/CPP/Common/Wildcard.cpp +++ b/CPP/Common/Wildcard.cpp | |||
| @@ -255,7 +255,8 @@ ForDir nonrec [0, M) same as ForBoth-File | |||
| 255 | 255 | ||
| 256 | bool CItem::AreAllAllowed() const | 256 | bool CItem::AreAllAllowed() const |
| 257 | { | 257 | { |
| 258 | return ForFile && ForDir && WildcardMatching && PathParts.Size() == 1 && PathParts.Front() == L"*"; | 258 | return ForFile && ForDir && WildcardMatching |
| 259 | && PathParts.Size() == 1 && PathParts.Front().IsEqualTo("*"); | ||
| 259 | } | 260 | } |
| 260 | 261 | ||
| 261 | bool CItem::CheckPath(const UStringVector &pathParts, bool isFile) const | 262 | bool CItem::CheckPath(const UStringVector &pathParts, bool isFile) const |
| @@ -542,7 +543,7 @@ unsigned GetNumPrefixParts_if_DrivePath(UStringVector &pathParts) | |||
| 542 | { | 543 | { |
| 543 | if (pathParts.Size() < 4 | 544 | if (pathParts.Size() < 4 |
| 544 | || !pathParts[1].IsEmpty() | 545 | || !pathParts[1].IsEmpty() |
| 545 | || pathParts[2] != L"?") | 546 | || !pathParts[2].IsEqualTo("?")) |
| 546 | return 0; | 547 | return 0; |
| 547 | testIndex = 3; | 548 | testIndex = 3; |
| 548 | } | 549 | } |
| @@ -574,11 +575,11 @@ static unsigned GetNumPrefixParts(const UStringVector &pathParts) | |||
| 574 | return 1; | 575 | return 1; |
| 575 | if (pathParts.Size() == 2) | 576 | if (pathParts.Size() == 2) |
| 576 | return 2; | 577 | return 2; |
| 577 | if (pathParts[2] == L".") | 578 | if (pathParts[2].IsEqualTo(".")) |
| 578 | return 3; | 579 | return 3; |
| 579 | 580 | ||
| 580 | unsigned networkParts = 2; | 581 | unsigned networkParts = 2; |
| 581 | if (pathParts[2] == L"?") | 582 | if (pathParts[2].IsEqualTo("?")) |
| 582 | { | 583 | { |
| 583 | if (pathParts.Size() == 3) | 584 | if (pathParts.Size() == 3) |
| 584 | return 3; | 585 | return 3; |
| @@ -642,7 +643,7 @@ void CCensor::AddItem(ECensorPathMode pathMode, bool include, const UString &pat | |||
| 642 | if (pathParts.Size() >= 3 | 643 | if (pathParts.Size() >= 3 |
| 643 | && pathParts[0].IsEmpty() | 644 | && pathParts[0].IsEmpty() |
| 644 | && pathParts[1].IsEmpty() | 645 | && pathParts[1].IsEmpty() |
| 645 | && pathParts[2] == L"?") | 646 | && pathParts[2].IsEqualTo("?")) |
| 646 | ignoreWildcardIndex = 2; | 647 | ignoreWildcardIndex = 2; |
| 647 | // #endif | 648 | // #endif |
| 648 | 649 | ||
| @@ -665,7 +666,7 @@ void CCensor::AddItem(ECensorPathMode pathMode, bool include, const UString &pat | |||
| 665 | for (unsigned i = numPrefixParts; i < pathParts.Size(); i++) | 666 | for (unsigned i = numPrefixParts; i < pathParts.Size(); i++) |
| 666 | { | 667 | { |
| 667 | const UString &part = pathParts[i]; | 668 | const UString &part = pathParts[i]; |
| 668 | if (part == L".." || part == L".") | 669 | if (part.IsEqualTo("..") || part.IsEqualTo(".")) |
| 669 | dotsIndex = (int)i; | 670 | dotsIndex = (int)i; |
| 670 | } | 671 | } |
| 671 | 672 | ||
