private static void AppendSeparatorIfNeeded(StringBuilder builder)
{
if (builder.Length > 0)
{
char c = builder[builder.Length - 1];
if (c != System.IO.Path.DirectorySeparatorChar && c != System.IO.Path.AltDirectorySeparatorChar)
{
builder.Append(System.IO.Path.DirectorySeparatorChar);
}
}
}
}