diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2009-08-23 14:28:38 +0200 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2009-08-23 14:28:38 +0200 |
commit | 6801959989defc3c360c5b7dc16c5bcc6a0f9c6b (patch) | |
tree | f29c165d718a4d43a4d33412ae6cb544d0d96789 /libssh/scp.c | |
parent | 8463d9d7c6719d4b326f0d9dc539387ebe85a35f (diff) | |
download | libssh-6801959989defc3c360c5b7dc16c5bcc6a0f9c6b.tar.gz libssh-6801959989defc3c360c5b7dc16c5bcc6a0f9c6b.tar.xz libssh-6801959989defc3c360c5b7dc16c5bcc6a0f9c6b.zip |
Use ssh_basename on ssh_scp_file_push'ed files
Diffstat (limited to 'libssh/scp.c')
-rw-r--r-- | libssh/scp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libssh/scp.c b/libssh/scp.c index 0ca7b442..06725e35 100644 --- a/libssh/scp.c +++ b/libssh/scp.c @@ -134,11 +134,14 @@ int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, const char char buffer[1024]; int r; uint8_t code; + char *file; if(scp->state != SSH_SCP_WRITE_INITED){ ssh_set_error(scp->session,SSH_FATAL,"ssh_scp_push_file called under invalid state"); return SSH_ERROR; } - snprintf(buffer, sizeof(buffer), "C%s %" PRIdS " %s\n", perms, size, filename); + file=ssh_basename(filename); + snprintf(buffer, sizeof(buffer), "C%s %" PRIdS " %s\n", perms, size, file); + SAFE_FREE(file); r=channel_write(scp->channel,buffer,strlen(buffer)); if(r==SSH_ERROR){ scp->state=SSH_SCP_ERROR; |