Kaynağa Gözat

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

https://winscp.net/tracker/2076
(cherry picked from commit 160289d1ff58b8a3d450966128f89b91b03cc990)

Source commit: 51fb0cd95b29b712d388ef7feca554864f34975d
Martin Prikryl 3 yıl önce
ebeveyn
işleme
942eccb3f6
1 değiştirilmiş dosya ile 10 ekleme ve 5 silme
  1. 10 5
      source/filezilla/FtpListResult.cpp

+ 10 - 5
source/filezilla/FtpListResult.cpp

@@ -303,12 +303,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;