Bug - Fixed svn commands do not match CAPital latters

Bale

Minion
svn commands that need to match an installed script will fail to recognize capital letters. At lest the "delete" command didn't work so I suspect that others might have trouble as well. Thank goodness a partial match works:

> svn list

bale-relay-Desc_WikiLinks
bale-relay-Monster_Manuel_Improvement
bumcheekascend-snapshot
mafia-ocd
mafiachit

> svn delete desc

No script matching desc is currently installed.

> svn delete desc_wikilinks

No script matching desc_wikilinks is currently installed.

> svn delete bale-relay-Desc_WikiLinks

No script matching bale-relay-Desc_WikiLinks is currently installed.

> svn delete WikiLinks

No script matching WikiLinks is currently installed.

> svn delete esc_

Uninstalling project...
relay\desc_effect.ash => DELETED
relay\desc_familiar.ash => DELETED
relay\desc_item.ash => DELETED
relay\desc_outfit.ash => DELETED
relay\desc_skill.ash => DELETED
 

roippi

Developer
Odd, I just used StringUtilities.getMatchingNames() which is used in a bunch of other places. Guess that bug exists in those places too.
 

roippi

Developer
Well, this is a longstanding "bug", I guess. I'll walk through it. StringUtilities.getMatchingNames does this:

Code:
searchString = StringUtilities.getCanonicalName( searchString.trim() );

and getCanonicalName does this:

Code:
			name = new String( name );

			canonicalName = StringUtilities.getEntityEncode( name ).toLowerCase();
			if ( name.length() < 100 )
			{
				StringUtilities.canonicalNameCache.put( name, canonicalName );
			}

So the searchString is turned into all lowercase. Unfortunately the same never happens to the list of names being searched:

(ignore the stuff about hashes)

Code:
		int hash = StringUtilities.stringHash( searchString );

		for ( int i = 0; i < nameCount; ++i )
		{
			if ( ( hashes[ i ] & hash ) == hash && StringUtilities.substringMatches( names[ i ], searchString, true ) )
			{
				matchList.add( names[ i ] );
			}
		}

So yeah. I guess this has never come up before because the list that was being searched against has always itself been canonicalized before searching. The reason I call it "bug" and not bug is that other callers do seem to run through the search list and canonicalize before doing the search, so maybe it's intentional.

I am so not messing around with the getMatchingNames method as I know that will subtly break things all over the place. Also, I can't just global toLowerCase the names of the projects being searched, as project/ and Project/ are different folders on some OS.

I'll just... one-off implementation this thing, since this is the one time we care about case.
 

Bale

Minion
You're killing off svn related bug reports so fast that I wonder if you can find time to eat.
 
Top