Browse Source

Bug 2076: z/OS PDS members without ISPF statistics are omitted in directory listing

https://winscp.net/tracker/2076

Source commit: 20ab9e6d90c0e10e19cd409a4b4f0421f286d60e
Martin Prikryl 3 years ago
parent
commit
160289d1ff
1 changed files with 10 additions and 5 deletions
  1. 10 5
      source/filezilla/FtpListResult.cpp

+ 10 - 5
source/filezilla/FtpListResult.cpp

@@ -300,12 +300,17 @@ BOOL CFtpListResult::parseLine(const char *lineToParse, const int linelen, t_dir
 
   // name-only entries
   // (multiline VMS entries have only a name on the first line, so for VMS we have to skip this)
-  if (FLAGCLEAR(m_server.nServerType, FZ_SERVERTYPE_SUB_FTP_VMS) &&
-      (strchr(lineToParse, ' ') == NULL))
+  if (FLAGCLEAR(m_server.nServerType, FZ_SERVERTYPE_SUB_FTP_VMS))
   {
-    direntry = t_directory::t_direntry();
-    copyStr(direntry.name, 0, lineToParse, strlen(lineToParse));
-    return TRUE;
+    RawByteString Buf(lineToParse);
+    // z/OS PDS members without ISPF statistics (name only) still have loads of spaces after them.
+    Buf = Buf.TrimRight();
+    if (Buf.Pos(' ') == 0)
+    {
+      direntry = t_directory::t_direntry();
+      direntry.name = Buf.c_str();
+      return TRUE;
+    }
   }
 
   return FALSE;