aboutsummaryrefslogtreecommitdiff
path: root/lib/ssh-libssh.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-02-28 15:35:58 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-03-01 09:24:45 +0100
commit14c95f8101f899b44da381bfe74668008093322b (patch)
tree74b823f971622e9a0192e4acfa928162b455bca6 /lib/ssh-libssh.c
parent64d598d91d1b69305e17fcb0b7cde15f5a50aff2 (diff)
ssh: fix Condition '!status' is always true
in the same sftp_done function in both SSH backends. Simplify them somewhat. Pointed out by Codacy. Closes #3628
Diffstat (limited to 'lib/ssh-libssh.c')
-rw-r--r--lib/ssh-libssh.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/ssh-libssh.c b/lib/ssh-libssh.c
index 333df03ef..33798aebd 100644
--- a/lib/ssh-libssh.c
+++ b/lib/ssh-libssh.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 2017 - 2018 Red Hat, Inc.
+ * Copyright (C) 2017 - 2019 Red Hat, Inc.
*
* Authors: Nikos Mavrogiannopoulos, Tomas Mraz, Stanislav Zidek,
* Robert Kolcun, Andreas Schneider
@@ -2398,13 +2398,9 @@ static CURLcode sftp_done(struct connectdata *conn, CURLcode status,
/* Post quote commands are executed after the SFTP_CLOSE state to avoid
errors that could happen due to open file handles during POSTQUOTE
operation */
- if(!status && !premature && conn->data->set.postquote &&
- !conn->bits.retry) {
+ if(!premature && conn->data->set.postquote && !conn->bits.retry)
sshc->nextstate = SSH_SFTP_POSTQUOTE_INIT;
- state(conn, SSH_SFTP_CLOSE);
- }
- else
- state(conn, SSH_SFTP_CLOSE);
+ state(conn, SSH_SFTP_CLOSE);
}
return myssh_done(conn, status);
}