Skip to content

Commit c145f2a

Browse files
Merge pull request #4 from KirillOsenkov/master
Searching in the drive root folder (e.g. "C:\") should result in path…
2 parents efa9765 + c8995f5 commit c145f2a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

FF/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ internal static Int32 Main(String[] args)
112112
Console.WriteLine(Constants.TotalMatchesFmt, totalMatches.ToString("N0", CultureInfo.CurrentCulture));
113113
Console.WriteLine(Constants.TotalMatchesSizeFmt, totalMatchesSize.ToString("N0", CultureInfo.CurrentCulture));
114114
}
115-
}
115+
}
116116
else
117117
{
118118
returnValue = 1;
@@ -273,11 +273,11 @@ static private void RecurseFiles(String directory)
273273
String lookUpdirectory = String.Empty;
274274
if (directory.StartsWith(@"\\", StringComparison.OrdinalIgnoreCase))
275275
{
276-
lookUpdirectory += directory.Replace(@"\\", @"\\?\UNC\") + "\\*";
276+
lookUpdirectory += directory.Replace(@"\\", @"\\?\UNC\") + "\\*";
277277
}
278278
else
279279
{
280-
lookUpdirectory = "\\\\?\\" + directory + "\\*";
280+
lookUpdirectory = "\\\\?\\" + directory + "\\*";
281281
}
282282
NativeMethods.WIN32_FIND_DATA w32FindData;
283283

@@ -304,7 +304,7 @@ static private void RecurseFiles(String directory)
304304
{
305305
Interlocked.Increment(ref totalDirectories);
306306

307-
String subDirectory = directory + "\\" + w32FindData.cFileName;
307+
String subDirectory = Path.Combine(directory, w32FindData.cFileName);
308308
if (Options.IncludeDirectories)
309309
{
310310
if (IsNameMatch(subDirectory))
@@ -319,7 +319,7 @@ static private void RecurseFiles(String directory)
319319
}
320320
else
321321
{
322-
// It's a file so look at it.
322+
// It's a file so look at it.
323323
Interlocked.Increment(ref totalFiles);
324324

325325
Int64 fileSize = w32FindData.nFileSizeLow + ((Int64)w32FindData.nFileSizeHigh << 32);

0 commit comments

Comments
 (0)