proper base names;
authorwenzelm
Sun, 02 Oct 2022 17:01:29 +0200
changeset 76241 aa6ce2e51e6c
parent 76240 30d43e9b2077
child 76242 d704efeb01db
proper base names;
src/Pure/General/ssh.scala
--- a/src/Pure/General/ssh.scala	Sun Oct 02 16:26:48 2022 +0200
+++ b/src/Pure/General/ssh.scala	Sun Oct 02 17:01:29 2022 +0200
@@ -214,8 +214,8 @@
     }
 
     def read_dir(path: Path): List[String] =
-      run_sftp("@ls -1 -a " + sftp_path(path)).out_lines.flatMap(s =>
-        if (s == "." || s == ".." || s.endsWith("/.") || s.endsWith("/..")) None
+      run_sftp("@cd " + sftp_path(path) + "\n@ls -1 -a").out_lines.flatMap(s =>
+        if (s == "." || s == "..") None
         else Some(Library.perhaps_unprefix("./", s)))
 
     private def get_file[A](path: Path, f: Path => A): A = {