x) fix file separators

This commit is contained in:
Marc Hernandez 2023-11-04 12:32:23 -07:00
parent c26348afb2
commit 9a74f8ca15

View File

@ -66,10 +66,16 @@ static public class log
cat = autoCat; cat = autoCat;
} }
else else
{ {
var pathPieces = path.Split( '\\' ); var pathPieces = path.Split( '\\' );
var lastDir = pathPieces[ pathPieces.Length - 2 ]; if(pathPieces.Length < 2)
{
pathPieces = path.Split('/');
}
var lastDir = pathPieces[ pathPieces.Length - 2 ];
ImmutableInterlocked.AddOrUpdate( ref s_shortname, pathHash, lastDir, ( key, value ) => { return lastDir; } ); ImmutableInterlocked.AddOrUpdate( ref s_shortname, pathHash, lastDir, ( key, value ) => { return lastDir; } );