Skip to content

Commit

Permalink
CodeQL fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RikuVirtanen committed Feb 20, 2024
1 parent 8de792d commit 024f119
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,11 @@ private static async Task<List<FileItem>> GetFiles(FtpClient ftp, Input input, C
{
cancellationToken.ThrowIfCancellationRequested();

if (file.Type == FtpFileSystemObjectType.Link || file.Type == FtpFileSystemObjectType.Directory)
if (file.Name != "." && file.Name != ".." && file.Type != FtpFileSystemObjectType.File)
continue; // skip directories and links

if (file.Name != "." && file.Name != ".." && file.Type == FtpFileSystemObjectType.File)
{
if (Regex.IsMatch(file.Name, regexStr, RegexOptions.IgnoreCase) || FileMatchesMask(file.Name, input.FileMask))
files.Add(new FileItem(file));
}
if (Regex.IsMatch(file.Name, regexStr, RegexOptions.IgnoreCase) || FileMatchesMask(file.Name, input.FileMask))
files.Add(new FileItem(file));
}

return files;
Expand Down

0 comments on commit 024f119

Please sign in to comment.