Skip to content

Commit 53da5b8

Browse files
Merge pull request #253 from ejohnstown/rename
Rename
2 parents 80760b5 + 8028058 commit 53da5b8

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

src/wolfscp.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,15 +1564,21 @@ static int wolfSSH_SCP_cmd(WOLFSSH* ssh, const char* localName,
15641564
WSNPRINTF(cmd, cmdSz, "scp -%c %s", dir, remoteName);
15651565
ssh->scpBasePath = localName;
15661566
ret = wolfSSH_SCP_connect(ssh, (byte*)cmd);
1567-
if (dir == 't') {
1568-
ssh->scpState = SCP_SOURCE_BEGIN;
1569-
ssh->scpRequestState = SCP_SOURCE;
1570-
ret = DoScpSource(ssh);
1571-
}
1572-
else {
1573-
ssh->scpState = SCP_SINK_BEGIN;
1574-
ssh->scpRequestState = SCP_SINK;
1575-
ret = DoScpSink(ssh);
1567+
if (ret == WS_SUCCESS) {
1568+
if (dir == 't') {
1569+
ssh->scpState = SCP_SOURCE_BEGIN;
1570+
ssh->scpRequestState = SCP_SOURCE;
1571+
ret = DoScpSource(ssh);
1572+
}
1573+
else {
1574+
cmdSz = (word32)WSTRLEN(localName);
1575+
ret = ParseBasePathHelper(ssh, cmdSz);
1576+
if (ret == WS_SUCCESS) {
1577+
ssh->scpState = SCP_SINK_BEGIN;
1578+
ssh->scpRequestState = SCP_SINK;
1579+
ret = DoScpSink(ssh);
1580+
}
1581+
}
15761582
}
15771583
WFREE(cmd, ssh->ctx->heap, DYNTYPE_STRING);
15781584
}

0 commit comments

Comments
 (0)