mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-06 07:10:53 +03:00
#90 - only update cwd state if stat succeeds
This commit is contained in:
@@ -40,10 +40,11 @@ public class StatefulSFTPClient
|
||||
|
||||
public synchronized void cd(String dirname)
|
||||
throws IOException {
|
||||
cwd = cwdify(dirname);
|
||||
final String targetCwd = cwdify(dirname);
|
||||
if (statExistence(cwd) == null) {
|
||||
throw new SFTPException(cwd + ": does not exist");
|
||||
}
|
||||
cwd = targetCwd;
|
||||
log.debug("CWD = {}", cwd);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user