void __fastcall TCDirectoryOutline::SetDirectory(const TFileName NewDir) { if (NewDir.Length() > 0) { TFileName Path = ForceCase(ExpandFileName(NewDir)); int n = Path.Length(); if (n > 3 && Path.IsPathDelimiter(n)) Path.SetLength(n - 1); if (Path != FDirectory) { FDirectory = Path; chdir(FDirectory.c_str()); if (!SameLetter(Path[1], Drive)) Drive = Path[1]; else { WalkTree(Path); Change(); } } } }