On Sunday, September 15, 2024 at 4:13:52 PM UTC+2 [email protected] 
wrote:

This is handled in ShellCache::IsContextPathAllowed(LPCWSTR path). If 
right-clicking the folder itself, path will be c:\temp\wc

I'm considering to check the list of ignored paths for a trailing \* as 
follows (adding the ternary operator to check for \\).

        if (!I->empty() && I->at(I->size() - 1) == '*')
        {
            std::wstring str = I->substr(0, I->size() - *(I->at(I->size() - 
2) == '\\' ? 2 : *1*)*);


but first check that the string has at least two chars, otherwise a -2 
would make it crash.
 

Then c:\temp\wc\* would work, but it might crash on a single * (didn't 
check yet).

Or to check separately for trailing \:

        else if (!I->empty() && I->at(I->size() - 1) == '\')
        {
            std::wstring str = I->substr(0, I->size() - 1);
            if (_wcsnicmp(str.c_str(), path, str.size()) == 0)
                return FALSE;
        }


that would work too. I don't really have a preference here.
 

Basically treating \ as a wildcard character - then you could add 
c:\temp\wc\ as "ignore the wc folder and everything below".

What do you think? Any risk of regressions?


No, no risk of regressions.
 


While I was at it, I'd suggest to remove the check for !I->empty() in the 
if statement. There is already a separate statement:

        if (I->empty())
            continue;

just above. So we KNOW that I->empty() is false. Do I miss something here? 
(For comparison, TortoiseGit don't have that !I->empty() check).


yes, you can remove that.

Stefan

-- 
You received this message because you are subscribed to the Google Groups 
"TortoiseSVN-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tortoisesvn-dev/e3b1f0ee-16c3-44e5-8fa4-dbf6e168da07n%40googlegroups.com.

Reply via email to