mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-07 15:50:57 +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)
|
public synchronized void cd(String dirname)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
cwd = cwdify(dirname);
|
final String targetCwd = cwdify(dirname);
|
||||||
if (statExistence(cwd) == null) {
|
if (statExistence(cwd) == null) {
|
||||||
throw new SFTPException(cwd + ": does not exist");
|
throw new SFTPException(cwd + ": does not exist");
|
||||||
}
|
}
|
||||||
|
cwd = targetCwd;
|
||||||
log.debug("CWD = {}", cwd);
|
log.debug("CWD = {}", cwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user