File::getFileNameWithoutExtension issue

I’m having an issue with the File::getFileNameWithoutExtension function. It doesn’t seem to work correctly if i have a path to a file that has no name. It gives me back the extension rather than an empty string. Eg take this code:

juce::String fileName = juce::File( "c:\\tune.wav" ).getFileNameWithoutExtension();
assert( fileName == "tune" );
fileName = juce::File( "c:\\.wav" ).getFileNameWithoutExtension();
assert( fileName == "" );

The second assertion fails because the function returns “.wav”. Is it safe to assume that (lastDot > lastSlash) is a typo and should be >= due to the +1 that was done to the lastSlash variable?

Looks correct to me. On many (most?) filesystems, a name that starts with a dot is a hidden file, not an extension.