浏览代码

Bug 1416: Ignore blank lines in "ls" command output

https://winscp.net/tracker/1416

Source commit: 22f5f002d2165eba89f5401b8df2c346a413863b
Martin Prikryl 9 年之前
父节点
当前提交
e9a33df806
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      source/core/ScpFileSystem.cpp

+ 6 - 2
source/core/ScpFileSystem.cpp

@@ -1010,8 +1010,12 @@ void __fastcall TSCPFileSystem::ReadDirectory(TRemoteFileList * FileList)
 
           for (int Index = 0; Index < OutputCopy->Count; Index++)
           {
-            File = CreateRemoteFile(OutputCopy->Strings[Index]);
-            FileList->AddFile(File);
+            UnicodeString OutputLine = OutputCopy->Strings[Index];
+            if (!OutputLine.IsEmpty())
+            {
+              File = CreateRemoteFile(OutputCopy->Strings[Index]);
+              FileList->AddFile(File);
+            }
           }
         }
         __finally