File lister now handles . in directory names

This commit is contained in:
Peter Slattery 2020-09-07 14:29:32 -07:00
parent 6491a88d8a
commit 3a732f95b8
1 changed files with 4 additions and 0 deletions

View File

@ -29,6 +29,10 @@ FileViewUpdateWorkingDirectory(gs_const_string WorkingDirectory, file_view_state
u32 SecondLastSlashIndex = FindLast(SanitizedDirectory, LastSlashIndex - 1, '\\'); u32 SecondLastSlashIndex = FindLast(SanitizedDirectory, LastSlashIndex - 1, '\\');
SanitizedDirectory = Substring(SanitizedDirectory, 0, SecondLastSlashIndex); SanitizedDirectory = Substring(SanitizedDirectory, 0, SecondLastSlashIndex);
} }
else if (StringsEqual(LastDir, ConstString(".")))
{
SanitizedDirectory = Substring(SanitizedDirectory, 0, LastSlashIndex);
}
State->WorkingDirectory = PushString(&State->FileNamesArena, WorkingDirectory.Length + 2); State->WorkingDirectory = PushString(&State->FileNamesArena, WorkingDirectory.Length + 2);
PrintF(&State->WorkingDirectory, "%S", SanitizedDirectory); PrintF(&State->WorkingDirectory, "%S", SanitizedDirectory);